1
0
mirror of synced 2025-01-17 22:11:41 +03:00

* Added failing test case for RawSql.

This commit is contained in:
pookey 2007-06-20 12:39:56 +00:00
parent b3873ea6be
commit bd3995d80a

View File

@ -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);
}
}
?>