/** * @testdox boolean should return false to true as string */ public function testInvalidBooleanWithTrue() { $value = 'true'; $this->assertFalse(Validation::boolean($value)); }
/** * testBoolean method * * @return void */ public function testBoolean() { $this->assertTrue(Validation::boolean('0')); $this->assertTrue(Validation::boolean('1')); $this->assertTrue(Validation::boolean(0)); $this->assertTrue(Validation::boolean(1)); $this->assertTrue(Validation::boolean(true)); $this->assertTrue(Validation::boolean(false)); $this->assertFalse(Validation::boolean('true')); $this->assertFalse(Validation::boolean('false')); $this->assertFalse(Validation::boolean('-1')); $this->assertFalse(Validation::boolean('2')); $this->assertFalse(Validation::boolean('Boo!')); }
public function testValidBooleanWithBooleanFalse() { $value = false; $this->assertTrue(Validation::boolean($value)); }