1
0
mirror of synced 2024-12-13 14:56:01 +03:00

tests for DISTINCT functionality

This commit is contained in:
zYne 2007-06-08 20:16:51 +00:00
parent d04fa55354
commit b097669fbe

View File

@ -43,7 +43,22 @@ class Doctrine_Query_Select_TestCase extends Doctrine_UnitTestCase
$users = $q->execute();
$this->assertEqual($users[0]->value, 'zYne zYne@example.com');
}
public function testSelectDistinctIsSupported()
{
$q = new Doctrine_Query();
$q->distinct()->select('u.name')->from('User u');
$this->assertEqual($q->getSql(), "SELECT DISTINCT e.id AS e__id, e.name AS e__name FROM entity e WHERE (e.type = 0)");
}
public function testSelectDistinctIsSupported2()
{
$q = new Doctrine_Query();
$q->select('DISTINCT u.name')->from('User u');
$this->assertEqual($q->getSql(), "SELECT DISTINCT e.id AS e__id, e.name AS e__name FROM entity e WHERE (e.type = 0)");
}
public function testAggregateFunctionWithDistinctKeyword()
{
$q = new Doctrine_Query();