From f92307d06d5c8b5110a771612f796fcdce9143d3 Mon Sep 17 00:00:00 2001 From: Alexander Orabey Date: Wed, 25 Mar 2015 20:51:17 +0300 Subject: [PATCH] problem with LimitSubqueryOutputWalker when use InheritanceType Conflicts: tests/Doctrine/Tests/OrmFunctionalTestCase.php --- .../Doctrine/Tests/Models/Pagination/User.php | 27 +++++++++++++++++++ .../Tests/Models/Pagination/User1.php | 17 ++++++++++++ .../Tests/ORM/Functional/PaginationTest.php | 18 +++++++++++++ .../Doctrine/Tests/OrmFunctionalTestCase.php | 3 +++ 4 files changed, 65 insertions(+) create mode 100644 tests/Doctrine/Tests/Models/Pagination/User.php create mode 100644 tests/Doctrine/Tests/Models/Pagination/User1.php diff --git a/tests/Doctrine/Tests/Models/Pagination/User.php b/tests/Doctrine/Tests/Models/Pagination/User.php new file mode 100644 index 000000000..bb719ceaa --- /dev/null +++ b/tests/Doctrine/Tests/Models/Pagination/User.php @@ -0,0 +1,27 @@ +iterateWithOrderDescWithLimitAndOffset(true, $fetchJoinCollection, $dql, "name"); } + /** + * @dataProvider fetchJoinCollection + */ + public function testIterateWithOutputWalkersWithFetchJoinWithComplexOrderByReferencingJoinedWithLimitAndOffsetWithInheritanceType($fetchJoinCollection) + { + $dql = 'SELECT u FROM Doctrine\Tests\Models\Pagination\User u ORDER BY u.id'; + $this->iterateWithOrderAscWithLimit(true, $fetchJoinCollection, $dql, "name"); + $this->iterateWithOrderDescWithLimit(true, $fetchJoinCollection, $dql, "name"); + } + public function testIterateComplexWithOutputWalker() { $dql = 'SELECT g, COUNT(u.id) AS userCount FROM Doctrine\Tests\Models\CMS\CmsGroup g LEFT JOIN g.users u GROUP BY g HAVING COUNT(u.id) > 0'; @@ -663,6 +674,13 @@ class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($company); } + for ($i = 0; $i < 9; $i++) { + $user = new User1(); + $user->name = "name$i"; + $user->email = "email$i"; + $this->_em->persist($user); + } + $this->_em->flush(); } diff --git a/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/tests/Doctrine/Tests/OrmFunctionalTestCase.php index 3dc625445..f48d635f2 100644 --- a/tests/Doctrine/Tests/OrmFunctionalTestCase.php +++ b/tests/Doctrine/Tests/OrmFunctionalTestCase.php @@ -271,6 +271,8 @@ abstract class OrmFunctionalTestCase extends OrmTestCase 'Doctrine\Tests\Models\Pagination\Company', 'Doctrine\Tests\Models\Pagination\Logo', 'Doctrine\Tests\Models\Pagination\Department', + 'Doctrine\Tests\Models\Pagination\User', + 'Doctrine\Tests\Models\Pagination\User1', ), ); @@ -524,6 +526,7 @@ abstract class OrmFunctionalTestCase extends OrmTestCase $conn->executeUpdate('DELETE FROM pagination_logo'); $conn->executeUpdate('DELETE FROM pagination_department'); $conn->executeUpdate('DELETE FROM pagination_company'); + $conn->executeUpdate('DELETE FROM pagination_user'); } $this->_em->clear();