You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Doctrine_Ticket_2158_TestCase extends Doctrine_UnitTestCase
4
-
{
5
-
publicfunctionprepareTables()
6
-
{
7
-
$this->tables[] = "T2158_Model1";
8
-
$this->tables[] = "T2158_Model2";
9
-
parent::prepareTables();
10
-
}
11
-
12
-
publicfunctionprepareData()
13
-
{
14
-
$this->myModel = newT2158_Model1();
15
-
$this->myModel->save();
16
-
}
17
-
18
-
publicfunctiontestInit()
19
-
{
20
-
21
-
}
22
-
23
-
// This produces a failing test
24
-
publicfunctiontestTest()
25
-
{
26
-
$q = Doctrine_Core::getTable('T2158_Model2')->createQuery('m2')->leftJoin('m2.Relation m1 ON m2.id = m1.m2_id');
27
-
$this->assertEqual($q->getSqlQuery(), 'SELECT t.id AS t__id, t2.id AS t2__id, t2.title AS t2__title, t2.m2_id AS t2__m2_id FROM t2158__model2 t LEFT JOIN t2158__model1 t2 ON (t.id = t2.m2_id)');
28
-
//$rs = $q->execute();
29
-
}
30
-
}
31
-
32
-
class T2158_Model1 extends Doctrine_Record
33
-
{
34
-
publicfunctionsetTableDefinition()
35
-
{
36
-
$this->hasColumn('title', 'string');
37
-
$this->hasColumn('m2_id', 'integer');
38
-
}
39
-
}
40
-
41
-
class T2158_Model2 extends Doctrine_Record
42
-
{
43
-
publicfunctionsetTableDefinition()
44
-
{
45
-
}
46
-
47
-
48
-
publicfunctionsetUp()
49
-
{
50
-
$this->hasMany('T2158_Model1 as Relation', array(
51
-
'local' => 'id',
52
-
'foreign' => 'm2_id'
53
-
)
54
-
);
55
-
}
1
+
<?php
2
+
3
+
class Doctrine_Ticket_2158_TestCase extends Doctrine_UnitTestCase
4
+
{
5
+
publicfunctionprepareTables()
6
+
{
7
+
$this->tables[] = "T2158_Model1";
8
+
$this->tables[] = "T2158_Model2";
9
+
parent::prepareTables();
10
+
}
11
+
12
+
publicfunctionprepareData()
13
+
{
14
+
$this->myModel = newT2158_Model1();
15
+
$this->myModel->save();
16
+
}
17
+
18
+
publicfunctiontestInit()
19
+
{
20
+
21
+
}
22
+
23
+
// This produces a failing test
24
+
publicfunctiontestTest()
25
+
{
26
+
$q = Doctrine_Core::getTable('T2158_Model2')->createQuery('m2')->leftJoin('m2.Relation m1 ON m2.id = m1.m2_id');
27
+
$this->assertEqual($q->getSqlQuery(), 'SELECT t.id AS t__id, t2.id AS t2__id, t2.title AS t2__title, t2.m2_id AS t2__m2_id FROM t2158__model2 t LEFT JOIN t2158__model1 t2 ON (t.id = t2.m2_id)');
0 commit comments