Skip to content

Commit

Permalink
Fix setting static property in tests on PHP 8.3
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Aug 10, 2023
1 parent 833efac commit 2173d05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/lib/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ protected static function invokePrivate($object, $methodName, array $parameters
$property->setAccessible(true);

if (!empty($parameters)) {
$property->setValue($object, array_pop($parameters));
if ($property->isStatic()) {
$property->setValue(array_pop($parameters));
} else {
$property->setValue($object, array_pop($parameters));
}
}

if (is_object($object)) {
Expand Down

0 comments on commit 2173d05

Please sign in to comment.