8000 Merge branch '7.0' into 7.1 · symfony/symfony@db21ee4 · GitHub
[go: up one dir, main page]

Skip to content

Commit db21ee4

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: fix tests
2 parents b167190 + 61cf2b0 commit db21ee4

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,20 +1001,6 @@ public function testGetValueGetterThrowsExceptionIfUninitializedWithoutLazyGhost
10011001
$this->propertyAccessor->getValue(new UninitializedObjectProperty(), 'privateUninitialized');
10021002
}
10031003

1004-
private function createUninitializedObjectPropertyGhost(): UninitializedObjectProperty
1005-
{
1006-
$class = 'UninitializedObjectPropertyGhost';
1007-
1008-
if (!class_exists($class)) {
1009-
eval('class '.$class.ProxyHelper::generateLazyGhost(new \ReflectionClass(UninitializedObjectProperty::class)));
1010-
}
1011-
1012-
$this->assertTrue(class_exists($class));
1013-
1014-
return $class::createLazyGhost(initializer: function ($instance) {
1015-
});
1016-
}
1017-
10181004
public function testGetValuePropertyThrowsExceptionIfUninitializedWithLazyGhost()
10191005
{
10201006
$this->expectException(UninitializedPropertyException::class);
@@ -1034,4 +1020,22 @@ public function testGetValueGetterThrowsExceptionIfUninitializedWithLazyGhost()
10341020

10351021
$this->propertyAccessor->getValue($lazyGhost, 'privateUninitialized');
10361022
}
1023+
1024+
private function createUninitializedObjectPropertyGhost(): UninitializedObjectProperty
1025+
{
1026+
if (!class_exists(ProxyHelper::class)) {
1027+
$this->markTestSkipped(sprintf('Class "%s" is required to run this test.', ProxyHelper::class));
1028+
}
1029+
1030+
$class = 'UninitializedObjectPropertyGhost';
1031+
1032+
if (!class_exists($class)) {
1033+
eval('class '.$class.ProxyHelper::generateLazyGhost(new \ReflectionClass(UninitializedObjectProperty::class)));
1034+
}
1035+
1036+
$this->assertTrue(class_exists($class));
1037+
1038+
return $class::createLazyGhost(initializer: function ($instance) {
1039+
});
1040+
}
10371041
}

0 commit comments

Comments
 (0)
0