1
0
mirror of synced 2024-12-13 14:56:01 +03:00
This commit is contained in:
zYne 2007-09-20 19:57:13 +00:00
parent dc8280ab7a
commit cfededd6e7

View File

@ -40,8 +40,8 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
parent::prepareTables(); parent::prepareTables();
} }
public function testOneToOneAggregateRelationWithAliasesIsSupported() public function testOneToOneAggregateRelationWithAliasesIsSupported()
{ {
$city = new Record_City(); $city = new Record_City();
$country = $city->Country; $country = $city->Country;
@ -75,9 +75,9 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
public function testUnsetRelation() public function testUnsetRelation()
{ {
$user = new User(); $user = new User();
$user->name = "test"; $user->name = 'test';
$email = new Email(); $email = new Email();
$email->address = "test@test.com"; $email->address = 'test@test.com';
$user->Email = $email; $user->Email = $email;
$user->save(); $user->save();
$this->assertTrue($user->Email instanceOf Email); $this->assertTrue($user->Email instanceOf Email);
@ -85,19 +85,17 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
$user->save(); $user->save();
$this->assertTrue($user->Email instanceOf Doctrine_Null); $this->assertTrue($user->Email instanceOf Doctrine_Null);
} }
public function testSavingRelatedObjects() public function testSavingRelatedObjects()
{ {
$user = new gnatUser(); $user = new gnatUser();
$user->name = "test"; $user->name = 'test';
$email = new gnatEmail(); $email = new gnatEmail();
$email->address = "test3@test.com"; $email->address = 'test3@test.com';
$user->Email = $email; $user->Email = $email;
$user->save(); $user->save();
$this->assertTrue($user->Email instanceOf gnatEmail); $this->assertTrue($user->Email instanceOf gnatEmail);
$this->assertTrue($user->foreign_id != 0); $this->assertEqual($user->foreign_id, $user->Email->id);
$this->assertTrue($user->foreign_id != null);
$this->assertTrue($user->foreign_id == $user->Email->id);
} }
} }