Inheritance: extends BaseType
Beispiel #1
0
 /**
  * @dataProvider booleanTestProvider
  */
 public function testBooleanType($a, $test, $expected)
 {
     $bool = new BooleanType();
     $this->assertEquals($test, $bool->test($a));
     if ($bool->test($a)) {
         $this->assertEquals($expected, $bool->parse($a));
     }
 }
 public function testBooleanType()
 {
     $bool = new BooleanType();
     $this->assertTrue($bool->test('true'));
     $this->assertTrue($bool->test('false'));
     $this->assertTrue($bool->test('0'));
     $this->assertTrue($bool->test('1'));
     $this->assertFalse($bool->test('foo'));
     $this->assertFalse($bool->test('123'));
 }