Skip to content

Commit db4cede

Browse files
committed
Revert test change partially and skip with lazy objects.
1 parent e2079f9 commit db4cede

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/Tests/ORM/Functional/Ticket/GH10808Test.php

+14-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ protected function setUp(): void
3030

3131
public function testDQLDeferredEagerLoad(): void
3232
{
33+
if ($this->_em->getConfiguration()->isLazyProxyEnabled()) {
34+
self::markTestSkipped('Test requires lazy loading to be disabled');
35+
}
36+
3337
$appointment = new GH10808Appointment();
3438

3539
$this->_em->persist($appointment);
@@ -47,11 +51,18 @@ public function testDQLDeferredEagerLoad(): void
4751
// Clear the EM to prevent the recovery of the loaded instance, which would otherwise result in a proxy.
4852
$this->_em->clear();
4953

50-
self::assertTrue($this->_em->getUnitOfWork()->isUninitializedObject($deferredLoadResult->child));
51-
5254
$eagerLoadResult = $query->setHint(UnitOfWork::HINT_DEFEREAGERLOAD, false)->getSingleResult();
5355

54-
self::assertFalse($this->_em->getUnitOfWork()->isUninitializedObject($eagerLoadResult->child));
56+
self::assertNotEquals(
57+
GH10808AppointmentChild::class,
58+
get_class($deferredLoadResult->child),
59+
'$deferredLoadResult->child should be a proxy',
60+
);
61+
self::assertEquals(
62+
GH10808AppointmentChild::class,
63+
get_class($eagerLoadResult->child),
64+
'$eagerLoadResult->child should not be a proxy',
65+
);
5566
}
5667
}
5768

0 commit comments

Comments
 (0)