minor #11992 [Console][Command][LogicException] The command name cannot be empty. #11991 (skafandri)

This PR was submitted for the 2.5 branch but it was merged into the 2.6-dev branch instead (closes #11992).

Discussion
----------

[Console][Command][LogicException] The command name cannot be empty. #11991

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11991
| License       | MIT
| Doc PR        | #11991

Commits
-------

7d6fbd9 [Console][Command][LogicException] The command name cannot be empty. #11991
This commit is contained in:
Fabien Potencier 2014-09-23 11:01:06 +02:00
commit 56a7a60f52
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ class Command
$this->configure();
if (!$this->name) {
throw new \LogicException('The command name cannot be empty.');
throw new \LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this)));
}
}

View File

@ -41,7 +41,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \LogicException
* @expectedExceptionMessage The command name cannot be empty.
* @expectedExceptionMessage The command defined in "Symfony\Component\Console\Command\Command" cannot have an empty name.
*/
public function testCommandNameCannotBeEmpty()
{