diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-09-01 10:58:59 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-09-03 10:33:21 +0300 |
commit | 82239d8e3e0cb7b8992f3411320e362770cb26a2 (patch) | |
tree | f2832c9d1a5b3c8941e90336e39544460f49e363 /apps/files_trashbin/tests | |
parent | 0a5045ec8e38593c53647fe82d8ccc8f61eb66b8 (diff) |
Tests only: Forward calls to getUserValue and getAppValue
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_trashbin/tests')
-rw-r--r-- | apps/files_trashbin/tests/TrashbinTest.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 136d8121cfa..40c3256ee03 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -119,15 +119,25 @@ class TrashbinTest extends \Test\TestCase { \OC::$server->getAppManager()->enableApp('files_trashbin'); $config = \OC::$server->getConfig(); $mockConfig = $this->createMock(\OCP\IConfig::class); - $mockConfig->expects($this->any()) + $mockConfig ->method('getSystemValue') - ->willReturnCallback(function ($key, $default) use ($config) { + ->willReturnCallback(static function ($key, $default) use ($config) { if ($key === 'filesystem_check_changes') { return \OC\Files\Cache\Watcher::CHECK_ONCE; } else { return $config->getSystemValue($key, $default); } }); + $mockConfig + ->method('getUserValue') + ->willReturnCallback(static function ($userId, $appName, $key, $default = '') use ($config) { + return $config->getUserValue($userId, $appName, $key, $default); + }); + $mockConfig + ->method('getAppValue') + ->willReturnCallback(static function ($appName, $key, $default = '') use ($config) { + return $config->getAppValue($appName, $key, $default); + }); $this->overwriteService(\OC\AllConfig::class, $mockConfig); $this->trashRoot1 = '/' . self::TEST_TRASHBIN_USER1 . '/files_trashbin'; |