Guess yes/no values in php config manager
This commit is contained in:
parent
5466cd8688
commit
d0836b4313
2 changed files with 33 additions and 1 deletions
21
airtime_mvc/tests/application/configs/ConfigTest.php
Normal file
21
airtime_mvc/tests/application/configs/ConfigTest.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
require_once "../application/configs/conf.php";
|
||||
|
||||
class ConfigTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testIsYesValue()
|
||||
{
|
||||
foreach (["yes", "Yes", "True", "true", true] as $value) {
|
||||
$this->assertEquals(Config::isYesValue($value), true);
|
||||
}
|
||||
|
||||
foreach (["no", "No", "False", "false", false] as $value) {
|
||||
$this->assertEquals(Config::isYesValue($value), false);
|
||||
}
|
||||
|
||||
foreach (["", "anything", "0", 0, "1", 1, null] as $value) {
|
||||
$this->assertEquals(Config::isYesValue($value), false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue