Added a unit test for the shortcut name of the InputOption class

This commit is contained in:
Arnaud Kleinpeter 2012-05-02 00:44:56 +03:00 committed by Arnaud Kleinpeter
parent f433f6b059
commit cf9039e88b

View File

@ -35,6 +35,10 @@ class InputOptionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument');
$option = new InputOption('foo', '-f');
$this->assertEquals('f', $option->getShortcut(), '__construct() removes the leading - of the shortcut');
$option = new InputOption('foo');
$this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default');
$option = new InputOption('foo', '-');
$this->assertNull($option->getShortcut(), '__construct() makes the shortcut null if a single dash is specified as its name');
// mode argument
$option = new InputOption('foo', 'f');