Commit f92cd777 authored by meus's avatar meus

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

parent 86af4c77
......@@ -69,4 +69,18 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($ref->name, 'ref 1');
$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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment