mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Fix setting static property in tests on PHP 8.3
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
2ea6c5364d
commit
ee756579a7
2 changed files with 7 additions and 3 deletions
|
|
@ -1568,10 +1568,10 @@ class ViewTest extends \Test\TestCase {
|
|||
$defaultRootValue->setAccessible(true);
|
||||
$oldRoot = $defaultRootValue->getValue();
|
||||
$defaultView = new View('/foo/files');
|
||||
$defaultRootValue->setValue($defaultView);
|
||||
$defaultRootValue->setValue(null, $defaultView);
|
||||
$view = new View($root);
|
||||
$result = self::invokePrivate($view, 'shouldEmitHooks', [$path]);
|
||||
$defaultRootValue->setValue($oldRoot);
|
||||
$defaultRootValue->setValue(null, $oldRoot);
|
||||
$this->assertEquals($shouldEmit, $result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,11 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
|
|||
$property->setAccessible(true);
|
||||
|
||||
if (!empty($parameters)) {
|
||||
$property->setValue($object, array_pop($parameters));
|
||||
if ($property->isStatic()) {
|
||||
$property->setValue(null, array_pop($parameters));
|
||||
} else {
|
||||
$property->setValue($object, array_pop($parameters));
|
||||
}
|
||||
}
|
||||
|
||||
if (is_object($object)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue