From bd3995d80a222510128761fe51098b042f3a358b Mon Sep 17 00:00:00 2001 From: pookey Date: Wed, 20 Jun 2007 12:39:56 +0000 Subject: [PATCH] * Added failing test case for RawSql. --- tests/RawSqlTestCase.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/RawSqlTestCase.php b/tests/RawSqlTestCase.php index 0aba04d63..f3795a57a 100644 --- a/tests/RawSqlTestCase.php +++ b/tests/RawSqlTestCase.php @@ -221,5 +221,17 @@ class Doctrine_RawSql_TestCase extends Doctrine_UnitTestCase $this->assertEqual($query->getQuery(), "SELECT entity.name AS entity__name, entity.id AS entity__id FROM (SELECT entity.name FROM entity WHERE entity.name = 'something') WHERE entity.id = 2 ORDER BY entity.name"); } + + public function testJoin() + { + $query = new Doctrine_RawSql(); + + $query->parseQuery('SELECT {entity.name}, {phonenumber.*} FROM entity LEFT JOIN phonenumber ON phonenumber.entity_id = entity.id LIMIT 1'); + $query->addComponent('entity', 'Entity'); + $query->addComponent('phonenumber', 'Entity.Phonenumber'); + + $coll = $query->execute(); + $this->assertEqual($coll->count(), 1); + } } ?>