aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/lib/Files/ViewTest.php4
-rw-r--r--tests/lib/TestCase.php6
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index 18a6fca05b0..200b54d5829 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -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);
}
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index a242a51a887..f5fc9a6e8f2 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -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)) {