1
0
mirror of synced 2024-12-14 15:16:04 +03:00

DDC-1858 Added coverage to ticket. Functionality already implemented.

This commit is contained in:
Guilherme Blanco 2013-06-11 01:21:47 -04:00
parent 462173ad71
commit 4e99c5c127
2 changed files with 34 additions and 4 deletions

View File

@ -590,6 +590,14 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
{ {
$this->assertValidDQL("select COALESCE(NULLIF(u.name, ''), u.username) as Display FROM Doctrine\Tests\Models\CMS\CmsUser u"); $this->assertValidDQL("select COALESCE(NULLIF(u.name, ''), u.username) as Display FROM Doctrine\Tests\Models\CMS\CmsUser u");
} }
/**
* @gorup DDC-1858
*/
public function testHavingSupportIsNullExpression()
{
$this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING u.username IS NULL");
}
} }
/** @Entity */ /** @Entity */

View File

@ -1986,6 +1986,28 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
'SELECT r0_.id AS id0, r1_.id AS id1, r1_.passengerName AS passengerName2 FROM RoutingRoute r0_ INNER JOIN RoutingRouteBooking r1_ ON r0_.id = r1_.route_id ORDER BY r1_.passengerName DESC' 'SELECT r0_.id AS id0, r1_.id AS id1, r1_.passengerName AS passengerName2 FROM RoutingRoute r0_ INNER JOIN RoutingRouteBooking r1_ ON r0_.id = r1_.route_id ORDER BY r1_.passengerName DESC'
); );
} }
/**
* @group DDC-1858
*/
public function testHavingSupportIsNullExpression()
{
$this->assertSqlGeneration(
'SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING u.username IS NULL',
'SELECT c0_.name AS name0 FROM cms_users c0_ HAVING c0_.username IS NULL'
);
}
/**
* @group DDC-1858
*/
public function testHavingSupportResultVariableInExpression()
{
$this->assertSqlGeneration(
'SELECT u.name AS foo FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING foo IN (?1)',
'SELECT c0_.name AS name0 FROM cms_users c0_ HAVING name0 IN (?)'
);
}
} }
class MyAbsFunction extends \Doctrine\ORM\Query\AST\Functions\FunctionNode class MyAbsFunction extends \Doctrine\ORM\Query\AST\Functions\FunctionNode