diff options
Diffstat (limited to 'tests/lib/helper.php')
-rw-r--r-- | tests/lib/helper.php | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php index 03c6dacde64..bd527de160d 100644 --- a/tests/lib/helper.php +++ b/tests/lib/helper.php @@ -509,28 +509,9 @@ class Test_Helper extends \Test\TestCase { * @param $methodName * @param array $parameters * @return mixed + * @deprecated Please extend \Test\TestCase and use self::invokePrivate() then */ public static function invokePrivate($object, $methodName, array $parameters = array()) { - $reflection = new ReflectionClass(get_class($object)); - - if ($reflection->hasMethod($methodName)) { - $method = $reflection->getMethod($methodName); - - $method->setAccessible(true); - - return $method->invokeArgs($object, $parameters); - } elseif ($reflection->hasProperty($methodName)) { - $property = $reflection->getProperty($methodName); - - $property->setAccessible(true); - - if (!empty($parameters)) { - $property->setValue($object, array_pop($parameters)); - } - - return $property->getValue($object); - } - - return false; + return parent::invokePrivate($object, $methodName, $parameters); } } |