See also: xp://lang.types.Boolean
Inheritance: extends TestCase
コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: BooleanTestCase.php プロジェクト: swk/bluebox
 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);
 }