Skip to content

Commit 6e19d0b

Browse files
committed
fixed testOptionsFirst
1 parent 94af2f7 commit 6e19d0b

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

src/docopt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ function parse_argv($tokens, \ArrayIterator $options, $optionsFirst=false)
935935
$parsed = array_merge($parsed, parse_shorts($tokens, $options));
936936
}
937937
elseif ($optionsFirst) {
938-
return array_merge($parsed, array_map(function($v) { return new Argument(null, $v); }, $tokens));
938+
return array_merge($parsed, array_map(function($v) { return new Argument(null, $v); }, iterator_to_array($tokens)));
939939
}
940940
else {
941941
$parsed[] = new Argument(null, $tokens->move());

test/DocoptTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,6 @@ function testDefaultValueForPositionalArguments()
761761
# new Option('-o', null, 1),
762762
# new Option(null, '--verbose')]
763763

764-
/**
765-
* @group faulty
766-
*/
767764
public function testOptionsFirst()
768765
{
769766
$this->assertEquals($this->docopt('usage: prog [--opt] [<args>...]',

0 commit comments

Comments
 (0)