1
0
mirror of synced 2025-02-02 13:31:45 +03:00

UnitTest backport of "Failing test case for broken paginator case"

UnitTest backport of "Failing test case for broken paginator case" ( 192da14842 ).
The branch 2.x is very important because it's related to ZF2 doctrine module (see https://github.com/doctrine/DoctrineORMModule/blob/master/composer.json ) and specially this issue affects the use case of extending the ZF2 user entity defined in ZfcUser ( https://github.com/ZF-Commons/ZfcUser ).
This test is meant to show the need of the backport of e501137d1a
This commit is contained in:
neoglez 2015-09-21 08:52:46 +02:00
parent 2d1bc78749
commit a3ece3b419

View File

@ -351,6 +351,25 @@ ORDER BY b.id DESC'
);
}
/**
* This tests ordering by property that has the 'declared' field.
*/
public function testLimitSubqueryOrderByFieldFromMappedSuperclass()
{
$this->entityManager->getConnection()->setDatabasePlatform(new MySqlPlatform());
// now use the third one in query
$query = $this->entityManager->createQuery(
'SELECT b FROM Doctrine\Tests\ORM\Tools\Pagination\Banner b ORDER BY b.id DESC'
);
$query->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker');
$this->assertEquals(
'SELECT DISTINCT id_0 FROM (SELECT b0_.id AS id_0, b0_.name AS name_1 FROM Banner b0_) dctrn_result ORDER BY id_0 DESC',
$query->getSQL()
);
}
/**
* Tests order by on a subselect expression (mysql).
*/