. */ /** * Doctrine_Query_Groupby_TestCase * * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @author Konsta Vesterinen * @version $Revision$ * @category Object Relational Mapping * @link www.phpdoctrine.org * @since 1.0 */ class Doctrine_Query_Groupby_TestCase extends Doctrine_UnitTestCase { public function testAggregateFunctionsInHavingReturnValidSql() { $q = new Doctrine_Query(); $q->parseQuery('SELECT u.name, COUNT(p.id) count FROM User u LEFT JOIN u.Phonenumber p GROUP BY count'); $this->assertEqual($q->getQuery(), 'SELECT e.id AS e__id, e.name AS e__name, COUNT(p.id) AS p__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY p__0'); } }