1
0
mirror of synced 2024-12-14 15:16:04 +03:00

added test to ensure that a link to a hasOne resource can be unset

This commit is contained in:
meus 2007-08-11 16:23:59 +00:00
parent 86af4c771b
commit f92cd7771b

View File

@ -69,4 +69,18 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($ref->name, 'ref 1'); $this->assertEqual($ref->name, 'ref 1');
$this->assertEqual($ref->createdBy->name, 'ref 2'); $this->assertEqual($ref->createdBy->name, 'ref 2');
} }
public function testUnsetRelation()
{
$user = new User();
$user->name = "test";
$email = new Email();
$email->address = "test@test.com";
$user->Email = $email;
$user->save();
$this->assertTrue($user->Email instanceOf Email);
$user->Email = Email::getNullObject();
$user->save();
$this->assertTrue($user->Email instanceOf Doctrine_Null);
}
} }