mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(reflection): ReflectionMethod::setAccessible is noop since 8.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
6bc73b0dab
commit
56793fa5b8
3 changed files with 0 additions and 8 deletions
|
|
@ -375,7 +375,6 @@ class SharedMountTest extends TestCase {
|
|||
$mountProvider = Server::get(MountProvider::class);
|
||||
$reflectionClass = new \ReflectionClass($mountProvider);
|
||||
$reflectionCacheFactory = $reflectionClass->getProperty('cacheFactory');
|
||||
$reflectionCacheFactory->setAccessible(true);
|
||||
$reflectionCacheFactory->setValue($mountProvider, $cacheFactory);
|
||||
|
||||
// share to user
|
||||
|
|
|
|||
|
|
@ -102,14 +102,12 @@ class HelperStorageTest extends \Test\TestCase {
|
|||
private function getIncludeExternalStorage(): bool {
|
||||
$class = new \ReflectionClass(\OC_Helper::class);
|
||||
$prop = $class->getProperty('quotaIncludeExternalStorage');
|
||||
$prop->setAccessible(true);
|
||||
return $prop->getValue(null) ?? false;
|
||||
}
|
||||
|
||||
private function setIncludeExternalStorage(bool $include) {
|
||||
$class = new \ReflectionClass(\OC_Helper::class);
|
||||
$prop = $class->getProperty('quotaIncludeExternalStorage');
|
||||
$prop->setAccessible(true);
|
||||
$prop->setValue(null, $include);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -248,15 +248,10 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
|
|||
|
||||
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)) {
|
||||
if ($property->isStatic()) {
|
||||
$property->setValue(null, array_pop($parameters));
|
||||
|
|
|
|||
Loading…
Reference in a new issue