From ad42d14e686bcbde56418dd4172bcdda4ec26185 Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 8 Jun 2007 19:22:18 +0000 Subject: [PATCH] --- tests/Query/FromTestCase.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/Query/FromTestCase.php b/tests/Query/FromTestCase.php index 97452cad2..d10a1f990 100644 --- a/tests/Query/FromTestCase.php +++ b/tests/Query/FromTestCase.php @@ -108,6 +108,14 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase $q->select('u.name, g.name, p.phonenumber')->from('User u INNER JOIN u.Group g LEFT JOIN u.Phonenumber p'); $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, e2.id AS e2__id, e2.name AS e2__name, p.id AS p__id, p.phonenumber AS p__phonenumber FROM entity e INNER JOIN groupuser g ON e.id = g.user_id INNER JOIN entity e2 ON e2.id = g.group_id LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0 AND (e2.type = 1 OR e2.type IS NULL))"); - } + } + public function testMixingOfJoins2() + { + $q = new Doctrine_Query(); + + $q->select('u.name, g.name, p.phonenumber')->from('User u INNER JOIN u.Group.Phonenumber p'); + + $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, p.id AS p__id, p.phonenumber AS p__phonenumber FROM entity e INNER JOIN groupuser g ON e.id = g.user_id INNER JOIN entity e2 ON e2.id = g.group_id LEFT JOIN phonenumber p ON e2.id = p.entity_id WHERE (e.type = 0 AND (e2.type = 1 OR e2.type IS NULL))"); + } } ?>