$this->assertEqual($q->getQuery(),'SELECT e.id AS e__id, e.name AS e__name, ((RANDOM() + 2147483648) / 4294967296) AS e__0 FROM entity e WHERE (e.type = 0) ORDER BY e__0 DESC');
@@ -43,14 +53,4 @@ class Doctrine_Query_Orderby_TestCase extends Doctrine_UnitTestCase
...
@@ -43,14 +53,4 @@ class Doctrine_Query_Orderby_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($q->getQuery(),'SELECT e.id AS e__id, e.name AS e__name, COUNT(p.phonenumber) AS p__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) ORDER BY p__0 DESC');
$this->assertEqual($q->getQuery(),'SELECT e.id AS e__id, e.name AS e__name, COUNT(p.phonenumber) AS p__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) ORDER BY p__0 DESC');
}
}
publicfunctiontestOrderByRandomIsSupported()
{
$q=newDoctrine_Query();
$q->select('u.name, RANDOM() rand')
->from('User u')
->orderby('rand DESC');
$this->assertEqual($q->getQuery(),'SELECT e.id AS e__id, e.name AS e__name, ((RANDOM() + 2147483648) / 4294967296) AS e__0 FROM entity e WHERE (e.type = 0) ORDER BY e__0 DESC');
$this->assertEqual($q->getQuery(),"SELECT CONCAT(e.name, ' ', e2.address) AS e__0 FROM entity e INNER JOIN email e2 ON e.email_id = e2.id WHERE (e.type = 0)");