]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix TestCase::invokePrivate to work with static classes
authorVincent Petry <pvince81@owncloud.com>
Wed, 1 Jun 2016 11:59:37 +0000 (13:59 +0200)
committerVincent Petry <pvince81@owncloud.com>
Wed, 1 Jun 2016 12:28:59 +0000 (14:28 +0200)
tests/lib/TestCase.php

index 7ed121d3556cbaa9afcabfd4bd42e8e10e605183..a1f65f8ac822fa339b0541229b77a763537358b0 100644 (file)
@@ -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);