1
0
mirror of synced 2025-01-19 15:01:40 +03:00

Adding test to verify SQL generation with an expression in COUNT()

This commit is contained in:
Marco Pivetta 2014-08-27 01:55:28 +02:00
parent 91fa4c9be3
commit 02ba144c8d

View File

@ -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(