Skip to content

Commit

Permalink
Trigger the desired code path
Browse files Browse the repository at this point in the history
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: doctrine#7905
- Issue on optimisation: doctrine#7829
- PR on optimisation: doctrine#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
  • Loading branch information
lcobucci committed Feb 15, 2022
1 parent d78fa52 commit e344ab8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/Doctrine/Tests/ORM/Functional/PaginationTest.php
Expand Up @@ -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);
Expand Down

0 comments on commit e344ab8

Please sign in to comment.