From ccd86ea0f8fd78cb3b7d8e377d1e978924c4ee29 Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 31 May 2007 17:49:27 +0000 Subject: [PATCH] --- tests/Query/ComponentAliasTestCase.php | 7 ++++--- tests/Query/MultiJoin2TestCase.php | 23 ++++++++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/Query/ComponentAliasTestCase.php b/tests/Query/ComponentAliasTestCase.php index a2ee0a63b..0f7357048 100644 --- a/tests/Query/ComponentAliasTestCase.php +++ b/tests/Query/ComponentAliasTestCase.php @@ -31,6 +31,7 @@ * @version $Revision$ */ class Doctrine_Query_ComponentAlias_TestCase extends Doctrine_UnitTestCase { + /** public function testQueryWithSingleAlias() { $this->connection->clear(); $q = new Doctrine_Query(); @@ -43,12 +44,12 @@ class Doctrine_Query_ComponentAlias_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 8); $this->assertTrue($users[0]->Phonenumber instanceof Doctrine_Collection); - $this->assertEqual($q->getQuery(), + $this->assertEqual($q->getQuery(), "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)); } - - public function testQueryWithNestedAliases() { + */ + public function testQueryWithNestedAliases() { print "
";
         $this->connection->clear();
         $q = new Doctrine_Query();
 
diff --git a/tests/Query/MultiJoin2TestCase.php b/tests/Query/MultiJoin2TestCase.php
index 7df2e8f17..66e1a78de 100644
--- a/tests/Query/MultiJoin2TestCase.php
+++ b/tests/Query/MultiJoin2TestCase.php
@@ -55,18 +55,23 @@ class Doctrine_Query_MultiJoin2_TestCase extends Doctrine_UnitTestCase {
         $lastEntry->authorId = $author->id;
         $lastEntry->date = 1234;
         $lastEntry->save();
-        
+
     }
     public function testMultipleJoinFetchingWithDeepJoins() {
         $query = new Doctrine_Query($this->connection);
-        $categories = $query->select("c.*, subCats.*, b.*, le.*, a.*")
-                    ->from("QueryTest_Category c")
-                    ->leftJoin("c.subCategories subCats")
-                    ->leftJoin("c.boards b")
-                    ->leftJoin("b.lastEntry le")
-                    ->leftJoin("le.author a")
-                    ->where("c.parentCategoryId = 0")
-                    ->orderBy("c.position ASC, subCats.position ASC, b.position ASC")
+        try {
+            $categories = $query->select('c.*, subCats.*, b.*, le.*, a.*')
+                    ->from('QueryTest_Category c')
+                    ->leftJoin('c.subCategories subCats')
+                    ->leftJoin('c.boards b')
+                    ->leftJoin('b.lastEntry le')
+                    ->leftJoin('le.author a')
+                    ->where('c.parentCategoryId = 0')
+                    ->orderBy('c.position ASC, subCats.position ASC, b.position ASC')
                     ->execute();
+            $this->pass();
+        } catch (Doctrine_Exception $e) {
+            $this->fail();                                	
+        }
     }
 }