Adding test to verify SQL generation with an expression in COUNT()
This commit is contained in:
parent
91fa4c9be3
commit
02ba144c8d
@ -263,6 +263,21 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSupportsAggregateCountFunctionWithSimpleArithmetic()
|
||||||
|
{
|
||||||
|
$connMock = $this->_em->getConnection();
|
||||||
|
$orgPlatform = $connMock->getDatabasePlatform();
|
||||||
|
|
||||||
|
$connMock->setDatabasePlatform(new \Doctrine\DBAL\Platforms\MySqlPlatform);
|
||||||
|
|
||||||
|
$this->assertSqlGeneration(
|
||||||
|
'SELECT COUNT(CONCAT(u.id, u.name)) FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u.id',
|
||||||
|
'SELECT COUNT(CONCAT(c0_.id, c0_.name)) AS sclr_0 FROM cms_users c0_ GROUP BY c0_.id'
|
||||||
|
);
|
||||||
|
|
||||||
|
$connMock->setDatabasePlatform($orgPlatform);
|
||||||
|
}
|
||||||
|
|
||||||
public function testSupportsWhereClauseWithPositionalParameter()
|
public function testSupportsWhereClauseWithPositionalParameter()
|
||||||
{
|
{
|
||||||
$this->assertSqlGeneration(
|
$this->assertSqlGeneration(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user