30
30
* @since 1.0
31
31
* @version $Revision$
32
32
*/
33
- class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
33
+ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
34
34
{
35
- public function prepareData ()
35
+ public function prepareData ()
36
36
{ }
37
- public function prepareTables ()
38
- {
39
- $ this ->tables = array ('gnatUser ' ,'gnatEmail ' ,'Email ' ,'Entity ' ,'Record_City ' , 'Record_Country ' , 'SelfRefTest ' );
40
-
37
+ public function prepareTables ()
38
+ {
39
+ $ this ->tables = array ('GnatUser ' ,'GnatEmail ' ,'Email ' ,'Entity ' ,'Record_City ' , 'Record_Country ' , 'SelfRefTest ' );
40
+
41
41
parent ::prepareTables ();
42
42
}
43
43
@@ -46,27 +46,27 @@ public function testOneToOneAggregateRelationWithAliasesIsSupported()
46
46
$ city = new Record_City ();
47
47
$ country = $ city ->Country ;
48
48
49
- $ this ->assertTrue ($ country instanceof Record_Country);
49
+ $ this ->assertTrue ($ country instanceof Record_Country);
50
50
}
51
-
51
+
52
52
public function testSelfReferentialOneToOneRelationsAreSupported ()
53
53
{
54
54
$ ref = new SelfRefTest ();
55
-
55
+
56
56
$ rel = $ ref ->getTable ()->getRelation ('createdBy ' );
57
57
58
58
$ this ->assertEqual ($ rel ->getForeign (), 'id ' );
59
59
$ this ->assertEqual ($ rel ->getLocal (), 'created_by ' );
60
-
60
+
61
61
$ ref ->name = 'ref 1 ' ;
62
62
$ ref ->createdBy ->name = 'ref 2 ' ;
63
-
63
+
64
64
$ ref ->save ();
65
65
}
66
66
public function testSelfReferentialOneToOneRelationsAreSupported2 ()
67
67
{
68
68
$ this ->connection ->clear ();
69
-
69
+
70
70
$ ref = $ this ->conn ->queryOne ("FROM SelfRefTest s WHERE s.name = 'ref 1' " );
71
71
$ this ->assertEqual ($ ref ->name , 'ref 1 ' );
72
72
$ this ->assertEqual ($ ref ->createdBy ->name , 'ref 2 ' );
@@ -88,14 +88,14 @@ public function testUnsetRelation()
88
88
89
89
public function testSavingRelatedObjects ()
90
90
{
91
- $ user = new gnatUser ();
91
+ $ user = new GnatUser ();
92
92
$ user ->name = 'test ' ;
93
- $ email = new gnatEmail ();
93
+ $ email = new GnatEmail ();
94
94
$ email->
address =
'[email protected] ' ;
95
95
$ user ->Email = $ email ;
96
96
$ user ->save ();
97
- $ this ->assertTrue ($ user ->Email instanceOf gnatEmail );
97
+ $ this ->assertTrue ($ user ->Email instanceOf GnatEmail );
98
98
$ this ->assertEqual ($ user ->foreign_id , $ user ->Email ->id );
99
-
99
+
100
100
}
101
101
}
0 commit comments