Fix #20482: Fix deprecation of ReflectionMethod::setAccessible() in PHP 8.5

This commit is contained in:
Wilmer Arambula
2025-08-20 08:31:47 -04:00
committed by GitHub
parent 5aabdd3a21
commit f5a071b1f8
13 changed files with 120 additions and 50 deletions

View File

@ -183,13 +183,8 @@ class AssetControllerTest extends TestCase
protected function invokeAssetControllerMethod($methodName, array $args = [])
{
$controller = $this->createAssetController();
$controllerClassReflection = new \ReflectionClass(get_class($controller));
$methodReflection = $controllerClassReflection->getMethod($methodName);
$methodReflection->setAccessible(true);
$result = $methodReflection->invokeArgs($controller, $args);
$methodReflection->setAccessible(false);
return $result;
return $this->invokeMethod($controller, $methodName, $args);
}
/**