8000 Added a unit test for the shortcut name of the InputOption class · symfony/symfony@cf9039e · GitHub
[go: up one dir, main page]

Skip to content

Commit cf9039e

Browse files
Arnaud Kleinpeternanocom
Arnaud Kleinpeter
authored andcommitted
Added a unit test for the shortcut name of the InputOption class
1 parent f433f6b commit cf9039e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Console/Tests/Input/InputOptionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public function testConstructor()
3535
$this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument');
3636
$option = new InputOption('foo', '-f');
3737
$this->assertEquals('f', $option->getShortcut(), '__construct() removes the leading - of the shortcut');
38+
$option = new InputOption('foo');
39+
$this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default');
40+
$option = new InputOption('foo', '-');
41+
$this->assertNull($option->getShortcut(), '__construct() makes the shortcut null if a single dash is specified as its name');
3842

3943
// mode argument
4044
$option = new InputOption('foo', 'f');

0 commit comments

Comments
 (0)
0