Commit b9be106f authored by zYne's avatar zYne

--no commit message

--no commit message
parent 28af01fd
...@@ -51,6 +51,7 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase ...@@ -51,6 +51,7 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase
$c->City[0]->District->name = 'District 1'; $c->City[0]->District->name = 'District 1';
$c->City[2]->District->name = 'District 2'; $c->City[2]->District->name = 'District 2';
$this->assertTrue($c->City[0]->get('district_id') === $c->City[0]->District);
$c->save(); $c->save();
...@@ -92,14 +93,4 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase ...@@ -92,14 +93,4 @@ class Doctrine_Query_Join_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($q->getQuery(), 'SELECT e.id AS e__id, e.name AS e__name FROM entity e INNER JOIN entity_reference e3 ON e.id = e3.entity1 OR e.id = e3.entity2 INNER JOIN entity e2 ON e2.id = e3.entity2 OR e2.id = e3.entity1'); $this->assertEqual($q->getQuery(), 'SELECT e.id AS e__id, e.name AS e__name FROM entity e INNER JOIN entity_reference e3 ON e.id = e3.entity1 OR e.id = e3.entity2 INNER JOIN entity e2 ON e2.id = e3.entity2 OR e2.id = e3.entity1');
} }
/**
public function testSelfReferentialNestJoin()
{
$nest = new NestTest();
$rel = $nest->getTable()->getRelation('Parents');
$this->assertEqual($rel->getLocal(), 'parent_id');
$this->assertTrue($rel instanceof Doctrine_Association);
}
*/
} }
...@@ -76,9 +76,6 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase ...@@ -76,9 +76,6 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($users->count(), 5); $this->assertEqual($users->count(), 5);
$users[0]->Phonenumber[0]; $users[0]->Phonenumber[0];
$this->assertEqual($count, $this->dbh->count()); $this->assertEqual($count, $this->dbh->count());
$q->offset(2); $q->offset(2);
...@@ -186,6 +183,7 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase ...@@ -186,6 +183,7 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($q->getQuery(), $this->assertEqual($q->getQuery(),
"SELECT e.id AS e__id, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE e.id IN (SELECT DISTINCT e2.id FROM entity e2 WHERE (e2.name LIKE ? OR e2.name LIKE ?) AND (e2.type = 0) LIMIT 5) AND (e.name LIKE ? OR e.name LIKE ?) AND (e.type = 0)"); "SELECT e.id AS e__id, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE e.id IN (SELECT DISTINCT e2.id FROM entity e2 WHERE (e2.name LIKE ? OR e2.name LIKE ?) AND (e2.type = 0) LIMIT 5) AND (e.name LIKE ? OR e.name LIKE ?) AND (e.type = 0)");
} }
public function testConnectionFlushing() public function testConnectionFlushing()
{ {
$q = new Doctrine_Query(); $q = new Doctrine_Query();
...@@ -249,8 +247,8 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase ...@@ -249,8 +247,8 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase
$this->connection->clear(); $this->connection->clear();
$q = new Doctrine_Query(); $q = new Doctrine_Query();
$q->from("User")->where("User.Group.id = ?")->orderby("User.id DESC")->limit(5); $q->from('User')->where('User.Group.id = ?')->orderby('User.id DESC')->limit(5);
$users = $q->execute(array(3)); $users = $q->execute(array(12));
$this->assertEqual($users->count(), 3); $this->assertEqual($users->count(), 3);
...@@ -287,5 +285,6 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase ...@@ -287,5 +285,6 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($q->getQuery(), $this->assertEqual($q->getQuery(),
"SELECT p.id AS p__id, p.name AS p__name FROM photo p LEFT JOIN phototag p2 ON p.id = p2.photo_id LEFT JOIN tag t ON t.id = p2.tag_id WHERE p.id IN (SELECT DISTINCT p3.id FROM photo p3 LEFT JOIN phototag p4 ON p3.id = p4.photo_id LEFT JOIN tag t2 ON t2.id = p4.tag_id WHERE t2.id = ? ORDER BY p3.id DESC LIMIT 100) AND t.id = ? ORDER BY p.id DESC"); "SELECT p.id AS p__id, p.name AS p__name FROM photo p LEFT JOIN phototag p2 ON p.id = p2.photo_id LEFT JOIN tag t ON t.id = p2.tag_id WHERE p.id IN (SELECT DISTINCT p3.id FROM photo p3 LEFT JOIN phototag p4 ON p3.id = p4.photo_id LEFT JOIN tag t2 ON t2.id = p4.tag_id WHERE t2.id = ? ORDER BY p3.id DESC LIMIT 100) AND t.id = ? ORDER BY p.id DESC");
} }
} }
?> ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment