Skip to content

Commit

Permalink
Test case for issue doctrine#11741
Browse files Browse the repository at this point in the history
  • Loading branch information
aprat84 committed Nov 28, 2024
1 parent 4bda514 commit 1ec02ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Tests/ORM/Functional/EagerFetchCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Query\QueryException;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Doctrine\Tests\OrmFunctionalTestCase;

use function count;
use function iterator_to_array;

class EagerFetchCollectionTest extends OrmFunctionalTestCase
{
Expand Down Expand Up @@ -96,6 +98,16 @@ public function testSubselectFetchJoinWithAllowedWhenOverriddenNotEager(): void
$this->assertIsString($query->getSql());
}

public function testSubselectFetchJoinWithAllowedWhenOverriddenNotEagerPaginator(): void
{
$query = $this->_em->createQuery('SELECT o, c FROM ' . EagerFetchOwner::class . ' o JOIN o.children c WITH c.id = 1');
$query->setMaxResults(1);
$query->setFetchMode(EagerFetchChild::class, 'owner', ORM\ClassMetadata::FETCH_LAZY);

$paginator = new Paginator($query, true);
$this->assertIsArray(iterator_to_array($paginator));
}

public function testEagerFetchWithIterable(): void
{
$this->createOwnerWithChildren(2);
Expand Down

0 comments on commit 1ec02ca

Please sign in to comment.