1
0
mirror of synced 2025-01-29 19:41:45 +03:00

* Adding an orderby test case to aggregate test

This commit is contained in:
pookey 2007-06-20 13:09:26 +00:00
parent 6a03325dbe
commit 689469a979

View File

@ -108,6 +108,23 @@ class Doctrine_Query_AggregateValue_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($users[1]->count, 2);
}
public function testAggregateOrder()
{
$q = new Doctrine_Query();
$q->select('u.name, COUNT(u.id) count')->from('User u')->groupby('u.name')->orderby('count');
$users = $q->execute();
$this->assertEqual($users->count(), 2);
$this->assertEqual($users[0]->state(), Doctrine_Record::STATE_PROXY);
$this->assertEqual($users[1]->state(), Doctrine_Record::STATE_PROXY);
$this->assertEqual($users[0]->count, 2);
$this->assertEqual($users[1]->count, 2);
}
public function testAggregateValueMappingSupportsLeftJoins()
{
$q = new Doctrine_Query();