@@ -829,16 +829,26 @@ public function testIssue59()
829829
830830 public function testOptionsFirst ()
831831 {
832- $ this ->assertEquals ($ this ->docopt ('usage: prog [--opt] [<args>...] ' ,
833- '--opt this that ' )->args , array ('--opt ' =>true ,
834- '<args> ' =>array ('this ' , 'that ' )));
835- $ this ->assertEquals ($ this ->docopt ('usage: prog [--opt] [<args>...] ' ,
836- 'this that --opt ' )->args , array ('--opt ' =>true ,
837- '<args> ' =>array ('this ' , 'that ' )));
838- $ this ->assertEquals ($ this ->docopt ('usage: prog [--opt] [<args>...] ' ,
839- 'this that --opt ' ,
840- array ('optionsFirst ' =>true ))->args , array ('--opt ' =>false ,
841- '<args> ' =>array ('this ' , 'that ' , '--opt ' )));
832+ $ this ->assertEquals (
833+ $ this ->docopt ('usage: prog [--opt] [<args>...] ' , '--opt this that ' )->args ,
834+ array ('--opt ' =>true , '<args> ' =>array ('this ' , 'that ' ))
835+ );
836+
837+ $ this ->assertEquals (
838+ $ this ->docopt ('usage: prog [--opt] [<args>...] ' , 'this that --opt ' )->args ,
839+ array ('--opt ' =>true , '<args> ' =>array ('this ' , 'that ' ))
840+ );
841+
842+ $ this ->assertEquals (
843+ $ this ->docopt ('usage: prog [--opt] [<args>...] ' , 'this that --opt ' , array ('optionsFirst ' =>true ))->args ,
844+ array ('--opt ' =>false , '<args> ' =>array ('this ' , 'that ' , '--opt ' ))
845+ );
846+
847+ // found issue with PHP version in this situation
848+ $ this ->assertEquals (
849+ $ this ->docopt ('usage: prog [--opt=<val>] [<args>...] ' , ' --opt=foo this that --opt ' , array ('optionsFirst ' =>true ))->args ,
850+ array ('--opt ' =>'foo ' , '<args> ' =>array ('this ' , 'that ' , '--opt ' ))
851+ );
842852 }
843853
844854 public function testIssue68OptionsShortcutDoesNotIncludeOptionsInUsagePattern ()
0 commit comments