public function testSetBooleanWithNumericZeroOrOne() { $this->manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL); $test = new BooleanTest(); $test->is_working = '1'; $test->save(); $test = new BooleanTest(); $test->is_working = '0'; $test->save(); $this->manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_NONE); }
public function testSavingNullValue() { $test = new BooleanTest(); $test->is_working = null; $this->assertIdentical($test->is_working, null); $this->assertEqual($test->state(), Doctrine_Record::STATE_TDIRTY); $test->save(); $test->refresh(); $this->assertIdentical($test->is_working, null); $test = new BooleanTest(); $test->is_working_notnull = null; $this->assertIdentical($test->is_working_notnull, false); $this->assertEqual($test->state(), Doctrine_Record::STATE_TDIRTY); $test->save(); $test->refresh(); $this->assertIdentical($test->is_working_notnull, false); }