@@ -227,7 +227,7 @@ public function testGetValueThrowsExceptionIfUninitializedPropertyWithGetterOfAn
227
227
$ this ->expectException (UninitializedPropertyException::class);
228
228
$ this ->expectExceptionMessage ('The method "Symfony\Component\PropertyAccess\Tests\Fixtures\UninitializedPrivateProperty@anonymous::getUninitialized()" returned "null", but expected type "array". Did you forget to initialize a property or to make the return type nullable using "?array"? ' );
229
229
230
- $ object = new class () extends \ Symfony \ Component \ PropertyAccess \ Tests \ Fixtures \ UninitializedPrivateProperty {
230
+ $ object = new class () extends UninitializedPrivateProperty {
231
231
};
232
232
233
233
$ this ->propertyAccessor ->getValue ($ object , 'uninitialized ' );
@@ -978,20 +978,6 @@ public function testGetValueGetterThrowsExceptionIfUninitializedWithoutLazyGhost
978
978
$ this ->propertyAccessor ->getValue (new UninitializedObjectProperty (), 'privateUninitialized ' );
979
979
}
980
980
981
- private function createUninitializedObjectPropertyGhost (): UninitializedObjectProperty
982
- {
983
- $ class = 'UninitializedObjectPropertyGhost ' ;
984
-
985
- if (!class_exists ($ class )) {
986
- eval ('class ' .$ class .ProxyHelper::generateLazyGhost (new \ReflectionClass (UninitializedObjectProperty::class)));
987
- }
988
-
989
- $ this ->assertTrue (class_exists ($ class ));
990
-
991
- return $ class ::createLazyGhost (initializer: function ($ instance ) {
992
- });
993
- }
994
-
995
981
public function testGetValuePropertyThrowsExceptionIfUninitializedWithLazyGhost ()
996
982
{
997
983
$ this ->expectException (UninitializedPropertyException::class);
@@ -1011,4 +997,22 @@ public function testGetValueGetterThrowsExceptionIfUninitializedWithLazyGhost()
1011
997
1012
998
$ this ->propertyAccessor ->getValue ($ lazyGhost , 'privateUninitialized ' );
1013
999
}
1000
+
1001
+ private function createUninitializedObjectPropertyGhost (): UninitializedObjectProperty
1002
+ {
1003
+ if (!class_exists (ProxyHelper::class)) {
1004
+ $ this ->markTestSkipped (sprintf ('Class "%s" is required to run this test. ' , ProxyHelper::class));
1005
+ }
1006
+
1007
+ $ class = 'UninitializedObjectPropertyGhost ' ;
1008
+
1009
+ if (!class_exists ($ class )) {
1010
+ eval ('class ' .$ class .ProxyHelper::generateLazyGhost (new \ReflectionClass (UninitializedObjectProperty::class)));
1011
+ }
1012
+
1013
+ $ this ->assertTrue (class_exists ($ class ));
1014
+
1015
+ return $ class ::createLazyGhost (initializer: function ($ instance ) {
1016
+ });
1017
+ }
1014
1018
}
0 commit comments