merged branch pgodel/2.0 (PR #5914)
This PR was merged into the 2.0 branch.
Commits
-------
9aec4c8
Show correct class name InputArgument in error message
Discussion
----------
[Console] Show correct class name InputArgument in error message
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
This commit is contained in:
commit
5c57bbb435
@ -96,7 +96,7 @@ class InputArgument
|
||||
public function setDefault($default = null)
|
||||
{
|
||||
if (self::REQUIRED === $this->mode && null !== $default) {
|
||||
throw new \LogicException('Cannot set a default value except for Parameter::OPTIONAL mode.');
|
||||
throw new \LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
|
||||
}
|
||||
|
||||
if ($this->isArray()) {
|
||||
|
@ -82,7 +82,7 @@ class InputArgumentTest extends \PHPUnit_Framework_TestCase
|
||||
$this->fail('->setDefault() throws an Exception if you give a default value for a required argument');
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('\Exception', $e, '->parse() throws an \InvalidArgumentException exception if an invalid option is passed');
|
||||
$this->assertEquals('Cannot set a default value except for Parameter::OPTIONAL mode.', $e->getMessage());
|
||||
$this->assertEquals('Cannot set a default value except for InputArgument::OPTIONAL mode.', $e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user