@@ -55,6 +55,20 @@ public function testShortcut()
55
55
$ this ->assertEquals ('f|ff|fff ' , $ option ->getShortcut (), '__construct() removes the leading - of the shortcuts ' );
56
56
$ option = new InputOption ('foo ' );
57
57
$ this ->assertNull ($ option ->getShortcut (), '__construct() makes the shortcut null by default ' );
58
+ $ option = new InputOption ('foo ' , '' );
59
+ $ this ->assertNull ($ option ->getShortcut (), '__construct() makes the shortcut null when given an empty string ' );
60
+ $ option = new InputOption ('foo ' , []);
61
+ $ this ->assertNull ($ option ->getShortcut (), '__construct() makes the shortcut null when given an empty array ' );
62
+ $ option = new InputOption ('foo ' , ['f ' , '' , 'fff ' ]);
63
+ $ this ->assertEquals ('f|fff ' , $ option ->getShortcut (), '__construct() removes empty shortcuts ' );
64
+ $ option = new InputOption ('foo ' , 'f||fff ' );
65
+ $ this ->assertEquals ('f|fff ' , $ option ->getShortcut (), '__construct() removes empty shortcuts ' );
66
+ $ option = new InputOption ('foo ' , '0 ' );
67
+ $ this ->assertEquals ('0 ' , $ option ->getShortcut (), '-0 is an acceptable shortcut value ' );
68
+ $ option = new InputOption ('foo ' , ['0 ' , 'z ' ]);
69
+ $ this ->assertEquals ('0|z ' , $ option ->getShortcut (), '-0 is an acceptable shortcut value when embedded in an array ' );
70
+ $ option = new InputOption ('foo ' , '0|z ' );
71
+ $ this ->assertEquals ('0|z ' , $ option ->getShortcut (), '-0 is an acceptable shortcut value when embedded in a string-list ' );
58
72
}
59
73
60
74
public function testModes ()
0 commit comments