File tree 2 files changed +7
-1
lines changed
tests/Tests/ORM/Functional
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3039,10 +3039,12 @@ public function initializeObject(object $obj): void
3039
3039
3040
3040
if ($ obj instanceof PersistentCollection) {
3041
3041
$ obj ->initialize ();
3042
+
3043
+ return ;
3042
3044
}
3043
3045
3044
3046
if ($ this ->em ->getConfiguration ()->isLazyProxyEnabled ()) {
3045
- $ reflection = new ReflectionObject ($ obj );
3047
+ $ reflection = $ this -> em -> getClassMetadata ($ obj::class)-> getReflectionClass ( );
3046
3048
$ reflection ->initializeLazyObject ($ obj );
3047
3049
}
3048
3050
}
Original file line number Diff line number Diff line change @@ -241,6 +241,10 @@ public function testInitializeProxyOnGettingSomethingOtherThanTheIdentifier(): v
241
241
#[Group('DDC-1604 ' )]
242
242
public function testCommonPersistenceProxy (): void
243
243
{
244
+ if ($ this ->_em ->getConfiguration ()->isLazyProxyEnabled ()) {
245
+ self ::markTestSkipped ('Test only works with proxy generation disabled. ' );
246
+ }
247
+
244
248
$ id = $ this ->createProduct ();
245
249
246
250
$ entity = $ this ->_em ->getReference (ECommerceProduct::class, $ id );
You can’t perform that action at this time.
0 commit comments