mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Fix toBool() and add more test cases
This commit is contained in:
parent
f73580945d
commit
8147044802
2 changed files with 10 additions and 2 deletions
|
|
@ -123,18 +123,26 @@ class FunctionsTest extends \Codeception\TestCase\Test
|
|||
$this->assertTrue(tobool('on'));
|
||||
$this->assertTrue(tobool('ok'));
|
||||
$this->assertTrue(tobool('okay'));
|
||||
$this->assertTrue(tobool('oui'));
|
||||
$this->assertTrue(tobool('si'));
|
||||
$this->assertTrue(tobool('vrai'));
|
||||
$this->assertTrue(tobool('true'));
|
||||
$this->assertTrue(tobool(1));
|
||||
$this->assertTrue(tobool(-1));
|
||||
$this->assertTrue(tobool(true));
|
||||
$this->assertTrue(tobool(array(1, 2, 3)));
|
||||
$this->assertTrue(tobool(new stdClass));
|
||||
|
||||
$this->assertFalse(tobool('N'));
|
||||
$this->assertFalse(tobool('no'));
|
||||
$this->assertFalse(tobool('none'));
|
||||
$this->assertFalse(tobool('Nobody'));
|
||||
$this->assertFalse(tobool('false'));
|
||||
$this->assertFalse(tobool('off'));
|
||||
$this->assertFalse(tobool('OUT'));
|
||||
$this->assertFalse(tobool('Fuck you!'));
|
||||
$this->assertFalse(tobool(0));
|
||||
$this->assertFalse(tobool(0.00000000));
|
||||
$this->assertFalse(tobool(''));
|
||||
$this->assertFalse(tobool(false));
|
||||
$this->assertFalse(tobool(null));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue