@@ -324,7 +324,7 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
'SELECT c0_.id AS id0 FROM cms_users c0_ WHERE EXISTS (SELECT c1_.phonenumber FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = c0_.id)'
);
}
publicfunctiontestSupportsMemberOfExpression()
{
// "Get all users who have $phone as a phonenumber." (*cough* doesnt really make sense...)
...
...
@@ -577,4 +577,12 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
"ORDER BY r1_.departureDate ASC"
);
}
publicfunctiontestSubselectInSelect()
{
$this->assertSqlGeneration(
"SELECT u.name, (SELECT COUNT(p.phonenumber) FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234) pcount FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'",
"SELECT c0_.name AS name0, (SELECT COUNT(c1_.phonenumber) AS dctrn__ FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = 1234) AS pcount FROM cms_users c0_ WHERE c0_.name = 'jon'"