mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Add test for options with 0 value.
This commit is contained in:
parent
693ca5481e
commit
b20f6e132d
1 changed files with 12 additions and 0 deletions
|
@ -78,6 +78,18 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue