Skip to content
Permalink
Browse files

Add test for options with 0 value.

  • Loading branch information...
markstory committed Dec 11, 2012
1 parent 693ca54 commit b20f6e132d06968bc33a0f30dbb23d94a3ae51b4
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php
@@ -78,6 +78,18 @@ public function testAddOptionLong() {
$this->assertEquals(array('test' => 'value', 'help' => false), $result[0], 'Long parameter did not parse out');
}
/**
* test adding an option with a zero value
*
* @return void
*/
public function testAddOptionZero() {
$parser = new ConsoleOptionParser('test', false);
$parser->addOption('count', array());
$result = $parser->parse(array('--count', '0'));
$this->assertEquals(array('count' => '0', 'help' => false), $result[0], 'Zero parameter did not parse out');
}
/**
* test addOption with an object.
*

0 comments on commit b20f6e1

Please sign in to comment.
You can’t perform that action at this time.