コード例 #1
0
 public function testIsModifiedAndNullValues()
 {
     $a = new Author();
     $a->setFirstName('');
     $a->setLastName('Bar');
     $a->setAge(0);
     $a->save();
     $a->setFirstName(null);
     $this->assertTrue($a->isModified(), "Expected Author to be modified after changing empty string column value to NULL.");
     $a->setAge(null);
     $this->assertTrue($a->isModified(), "Expected Author to be modified after changing 0-value int column to NULL.");
     $a->setFirstName('');
     $this->assertTrue($a->isModified(), "Expected Author to be modified after changing NULL column value to empty string.");
     $a->setAge(0);
     $this->assertTrue($a->isModified(), "Expected Author to be modified after changing NULL column to 0-value int.");
 }