aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/helper.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-06-03 13:41:32 +0200
committerLukas Reschke <lukas@owncloud.com>2015-06-03 13:41:32 +0200
commit9ba5081d47e23a92198336ef4366c72c5a996a3b (patch)
treeed0d68500fe37e72ed2a7d6686c4bd85e5477324 /tests/lib/helper.php
parent7de2940b423c4b1728558dc2b09cf04610ccb9ba (diff)
parentd3e3a84cae9c8926bcff810a0e16bb9dcd024888 (diff)
downloadnextcloud-server-9ba5081d47e23a92198336ef4366c72c5a996a3b.tar.gz
nextcloud-server-9ba5081d47e23a92198336ef4366c72c5a996a3b.zip
Merge pull request #16710 from owncloud/move-invoke-private-to-base-class
Move the helpful invokePrivate method to the TestCase class
Diffstat (limited to 'tests/lib/helper.php')
-rw-r--r--tests/lib/helper.php23
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);
}
}