function testAssignmentBeforeEitherSaved() { $employe = new Employe(array('lastname' => 'Max', 'firstname' => 'Payne')); $profile = new Profile(array('cv' => 'Lone private')); $profile->employe = $employe; $this->assertTrue($profile->isNewRecord()); $this->assertTrue($employe->isNewRecord()); $profile->save(); $this->assertFalse($profile->isNewRecord()); $this->assertFalse($employe->isNewRecord()); $this->assertEqual($employe, $profile->employe); $this->assertEqual($employe, $profile->employe(True)); }