Skip to content

Commit

Permalink
shows correct class name InputOption in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
pgodel committed Nov 4, 2012
1 parent a09319d commit 762649f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Input/InputOption.php
Expand Up @@ -148,7 +148,7 @@ public function isArray()
public function setDefault($default = null)
{
if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) {
throw new \LogicException('Cannot set a default value when using Option::VALUE_NONE mode.');
throw new \LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.');
}

if ($this->isArray()) {
Expand Down
Expand Up @@ -121,7 +121,7 @@ public function testSetDefault()
$this->fail('->setDefault() throws an Exception if you give a default value for a VALUE_NONE option');
} catch (\Exception $e) {
$this->assertInstanceOf('\Exception', $e, '->setDefault() throws an Exception if you give a default value for a VALUE_NONE option');
$this->assertEquals('Cannot set a default value when using Option::VALUE_NONE mode.', $e->getMessage());
$this->assertEquals('Cannot set a default value when using InputOption::VALUE_NONE mode.', $e->getMessage());
}

$option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
Expand Down

0 comments on commit 762649f

Please sign in to comment.