File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,34 @@ public function testParsingNoOptions()
138138 $ this ->assertSame ($ expected , $ this ->request ->getOptionString ());
139139 }
140140
141+ public function testParsingArgs ()
142+ {
143+ $ _SERVER ['argv ' ] = [
144+ 'spark ' ,
145+ 'command ' ,
146+ 'param1 ' ,
147+ 'param2 ' ,
148+ '--opt1 ' ,
149+ 'opt1val ' ,
150+ '--opt-2 ' ,
151+ 'opt 2 val ' ,
152+ 'param3 ' ,
153+ ];
154+
155+ // reinstantiate it to force parsing
156+ $ this ->request = new CLIRequest (new App ());
157+
158+ $ options = [
159+ 'command ' ,
160+ 'param1 ' ,
161+ 'param2 ' ,
162+ 'opt1 ' => 'opt1val ' ,
163+ 'opt-2 ' => 'opt 2 val ' ,
164+ 'param3 ' ,
165+ ];
166+ $ this ->assertSame ($ options , $ this ->request ->getArgs ());
167+ }
168+
141169 public function testParsingPath ()
142170 {
143171 $ _SERVER ['argv ' ] = [
You can’t perform that action at this time.
0 commit comments