diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index aa2c720d83010c9c3271c23ee961c5630452c238..69cf2a39792329177849363e5c3eb16911f2822a 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -226,7 +226,11 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
 				$property->setValue($object, array_pop($parameters));
 			}
 
-			return $property->getValue($object);
+			if (is_object($object)) {
+				return $property->getValue($object);
+			}
+
+			return $property->getValue();
 		}
 
 		return false;