OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3897aec
)
add test for assoc arg with optional value
author
scribu
<mail@scribu.net>
Mon, 19 Aug 2013 22:41:51 +0000
(
01:41
+0300)
committer
scribu
<mail@scribu.net>
Mon, 19 Aug 2013 22:42:05 +0000
(
01:42
+0300)
tests/test-arg-validation.php
patch
|
blob
|
history
diff --git
a/tests/test-arg-validation.php
b/tests/test-arg-validation.php
index
f579823
..
e1c74b8
100644
(file)
--- a/
tests/test-arg-validation.php
+++ b/
tests/test-arg-validation.php
@@
-46,5
+46,15
@@
class ArgValidationTests extends PHPUnit_Framework_TestCase {
$this->assertCount( 1, $errors['fatal'] );
$this->assertCount( 1, $errors['warning'] );
}
+
+ function testAssocWithOptionalValue() {
+ $parser = new SynopsisValidator( '[--network[=<id>]]' );
+
+ $assoc_args = array( 'network' => true );
+ $errors = $parser->validate_assoc( $assoc_args );
+
+ $this->assertCount( 0, $errors['fatal'] );
+ $this->assertCount( 0, $errors['warning'] );
+ }
}