Skip to content

Commit

Permalink
Merge branch '7.0' into 7.1
Browse files Browse the repository at this point in the history
* 7.0:
  fix tests
  • Loading branch information
xabbuh committed Feb 16, 2024
2 parents b167190 + 61cf2b0 commit db21ee4
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1001,20 +1001,6 @@ public function testGetValueGetterThrowsExceptionIfUninitializedWithoutLazyGhost
$this->propertyAccessor->getValue(new UninitializedObjectProperty(), 'privateUninitialized');
}

private function createUninitializedObjectPropertyGhost(): UninitializedObjectProperty
{
$class = 'UninitializedObjectPropertyGhost';

if (!class_exists($class)) {
eval('class '.$class.ProxyHelper::generateLazyGhost(new \ReflectionClass(UninitializedObjectProperty::class)));
}

$this->assertTrue(class_exists($class));

return $class::createLazyGhost(initializer: function ($instance) {
});
}

public function testGetValuePropertyThrowsExceptionIfUninitializedWithLazyGhost()
{
$this->expectException(UninitializedPropertyException::class);
Expand All @@ -1034,4 +1020,22 @@ public function testGetValueGetterThrowsExceptionIfUninitializedWithLazyGhost()

$this->propertyAccessor->getValue($lazyGhost, 'privateUninitialized');
}

private function createUninitializedObjectPropertyGhost(): UninitializedObjectProperty
{
if (!class_exists(ProxyHelper::class)) {
$this->markTestSkipped(sprintf('Class "%s" is required to run this test.', ProxyHelper::class));
}

$class = 'UninitializedObjectPropertyGhost';

if (!class_exists($class)) {
eval('class '.$class.ProxyHelper::generateLazyGhost(new \ReflectionClass(UninitializedObjectProperty::class)));
}

$this->assertTrue(class_exists($class));

return $class::createLazyGhost(initializer: function ($instance) {
});
}
}

0 comments on commit db21ee4

Please sign in to comment.