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:
Fabien Potencier 2012-11-05 21:19:14 +01:00
commit 5c57bbb435
2 changed files with 2 additions and 2 deletions

View File

@ -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()) {

View File

@ -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 {