Commit ccd86ea0 authored by zYne's avatar zYne

--no commit message

--no commit message
parent d4c12c35
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
* @version $Revision$ * @version $Revision$
*/ */
class Doctrine_Query_ComponentAlias_TestCase extends Doctrine_UnitTestCase { class Doctrine_Query_ComponentAlias_TestCase extends Doctrine_UnitTestCase {
/**
public function testQueryWithSingleAlias() { public function testQueryWithSingleAlias() {
$this->connection->clear(); $this->connection->clear();
$q = new Doctrine_Query(); $q = new Doctrine_Query();
...@@ -47,8 +48,8 @@ class Doctrine_Query_ComponentAlias_TestCase extends Doctrine_UnitTestCase { ...@@ -47,8 +48,8 @@ class Doctrine_Query_ComponentAlias_TestCase extends Doctrine_UnitTestCase {
"SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0)"); "SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0)");
$this->assertEqual($count, count($this->dbh)); $this->assertEqual($count, count($this->dbh));
} }
*/
public function testQueryWithNestedAliases() { public function testQueryWithNestedAliases() { print "<pre>";
$this->connection->clear(); $this->connection->clear();
$q = new Doctrine_Query(); $q = new Doctrine_Query();
......
...@@ -59,14 +59,19 @@ class Doctrine_Query_MultiJoin2_TestCase extends Doctrine_UnitTestCase { ...@@ -59,14 +59,19 @@ class Doctrine_Query_MultiJoin2_TestCase extends Doctrine_UnitTestCase {
} }
public function testMultipleJoinFetchingWithDeepJoins() { public function testMultipleJoinFetchingWithDeepJoins() {
$query = new Doctrine_Query($this->connection); $query = new Doctrine_Query($this->connection);
$categories = $query->select("c.*, subCats.*, b.*, le.*, a.*") try {
->from("QueryTest_Category c") $categories = $query->select('c.*, subCats.*, b.*, le.*, a.*')
->leftJoin("c.subCategories subCats") ->from('QueryTest_Category c')
->leftJoin("c.boards b") ->leftJoin('c.subCategories subCats')
->leftJoin("b.lastEntry le") ->leftJoin('c.boards b')
->leftJoin("le.author a") ->leftJoin('b.lastEntry le')
->where("c.parentCategoryId = 0") ->leftJoin('le.author a')
->orderBy("c.position ASC, subCats.position ASC, b.position ASC") ->where('c.parentCategoryId = 0')
->orderBy('c.position ASC, subCats.position ASC, b.position ASC')
->execute(); ->execute();
$this->pass();
} catch (Doctrine_Exception $e) {
$this->fail();
}
} }
} }
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