From 12ab6fa43f8a834876ea435d06e0dcc1225191f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 15 Feb 2022 22:46:53 +0100 Subject: [PATCH] Trigger the desired code path Since v2.7.0 the ORM avoids using extra queries via the paginator component when maximum results isn't set on the original query. With that change, this test was not executing the code path that it was expected to run. This makes sure we trigger the forcing of custom DBAL types when hydrating the identifiers, making sure we don't introduce bugs. More info: - Forcing DBAL type conversion: https://github.com/doctrine/orm/pull/7905 - Issue on optimisation: https://github.com/doctrine/orm/issues/7829 - PR on optimisation: https://github.com/doctrine/orm/pull/7863 - Minor BC-break docs: https://github.com/doctrine/orm/blob/2.11.x/UPGRADE.md#minor-bc-break-paginator-output-walkers-arent-be-called-anymore-on-sub-queries-for-queries-without-max-results --- tests/Doctrine/Tests/ORM/Functional/PaginationTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php b/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php index 7bdfa16cdbe..571ad0a12ce 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php @@ -670,6 +670,7 @@ public function testCustomIdTypeWithoutOutputWalker(): void $dql = 'SELECT p FROM Doctrine\Tests\Models\CustomType\CustomIdObjectTypeParent p'; $query = $this->_em->createQuery($dql); + $query->setMaxResults(1); $paginator = new Paginator($query, true); $paginator->setUseOutputWalkers(false);