Skip to content

Commit

Permalink
Add test for options with 0 value.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 11, 2012
1 parent 693ca54 commit b20f6e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit b20f6e1

Please sign in to comment.