Created
May 19, 2009 15:19
-
-
Save hartym/114169 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Doctrine_Ticket_9999_TestCase extends Doctrine_UnitTestCase | |
{ | |
public function prepareTables() | |
{ | |
$this->tables[] = "Model1"; | |
$this->tables[] = "Model2"; | |
parent::prepareTables(); | |
} | |
public function prepareData() | |
{ | |
$this->myModel = new Model1(); | |
$this->myModel->save(); | |
} | |
public function testInit() | |
{ | |
} | |
// This produces a failing test | |
public function testTest() | |
{ | |
try | |
{ | |
Doctrine::getTable('Model2')->createQuery('m2')->leftJoin('m2.Relation m1 ON m2.id = m1.m2_id')->execute(); | |
$this->assertTrue(true); | |
} | |
catch(Doctrine_Exception $e) | |
{ | |
$this->assertTrue(false); | |
} | |
try | |
{ | |
Doctrine::getTable('Model2')->createQuery('m2')->leftJoin('m2.Relation m1 ON m2.id = m1.m2_id')->execute(); | |
$this->assertTrue(true); | |
} | |
catch(Doctrine_Exception $e) | |
{ | |
$this->assertTrue(false); | |
} | |
} | |
} | |
class Model1 extends Doctrine_Record | |
{ | |
public function setTableDefinition() | |
{ | |
$this->hasColumn('title', 'string'); | |
$this->hasColumn('m2_id', 'integer'); | |
} | |
} | |
class Model2 extends Doctrine_Record | |
{ | |
public function setUp() | |
{ | |
$this->hasMany('Model1 as Relation', array( | |
'local' => 'id', | |
'foreign' => 'm2_id' | |
) | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment