Commit db4cede 1 parent e2079f9 commit db4cede Copy full SHA for db4cede
File tree 1 file changed +14
-3
lines changed
tests/Tests/ORM/Functional/Ticket
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ protected function setUp(): void
30
30
31
31
public function testDQLDeferredEagerLoad (): void
32
32
{
33
+ if ($ this ->_em ->getConfiguration ()->isLazyProxyEnabled ()) {
34
+ self ::markTestSkipped ('Test requires lazy loading to be disabled ' );
35
+ }
36
+
33
37
$ appointment = new GH10808Appointment ();
34
38
35
39
$ this ->_em ->persist ($ appointment );
@@ -47,11 +51,18 @@ public function testDQLDeferredEagerLoad(): void
47
51
// Clear the EM to prevent the recovery of the loaded instance, which would otherwise result in a proxy.
48
52
$ this ->_em ->clear ();
49
53
50
- self ::assertTrue ($ this ->_em ->getUnitOfWork ()->isUninitializedObject ($ deferredLoadResult ->child ));
51
-
52
54
$ eagerLoadResult = $ query ->setHint (UnitOfWork::HINT_DEFEREAGERLOAD , false )->getSingleResult ();
53
55
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
+ );
55
66
}
56
67
}
57
68
You can’t perform that action at this time.
0 commit comments