diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-01 13:59:37 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-01 14:28:59 +0200 |
commit | 5b1eb416d87c0e85e60547003f9b01847c81ec8a (patch) | |
tree | cc6654fa5583034cfe7423905dca508e2f5d3eab | |
parent | 5ad8fa76756801eee2aac18459aed60d03b4d4bc (diff) | |
download | nextcloud-server-5b1eb416d87c0e85e60547003f9b01847c81ec8a.tar.gz nextcloud-server-5b1eb416d87c0e85e60547003f9b01847c81ec8a.zip |
Fix TestCase::invokePrivate to work with static classes
-rw-r--r-- | tests/lib/TestCase.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 7ed121d3556..a1f65f8ac82 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -166,7 +166,12 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { * @return mixed */ protected static function invokePrivate($object, $methodName, array $parameters = array()) { - $reflection = new \ReflectionClass(get_class($object)); + if (is_string($object)) { + $className = $object; + } else { + $className = get_class($object); + } + $reflection = new \ReflectionClass($className); if ($reflection->hasMethod($methodName)) { $method = $reflection->getMethod($methodName); |