diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-09-01 09:58:59 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-09-04 12:30:01 +0200 |
commit | 062ce5444dfbb55cf93359c232d2e6e315b91593 (patch) | |
tree | 872f9e3dc9dcab94eaec6d80f8c08a85d397307f /apps/files_trashbin | |
parent | d6b7ad7109149d26bb34b8128f74a99f856d3963 (diff) | |
download | nextcloud-server-062ce5444dfbb55cf93359c232d2e6e315b91593.tar.gz nextcloud-server-062ce5444dfbb55cf93359c232d2e6e315b91593.zip |
Tests only: Forward calls to getUserValue and getAppValue
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_trashbin')
-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 1e041498390..806a8b765a0 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -120,15 +120,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') - ->will($this->returnCallback(function ($key, $default) use ($config) { + ->will($this->returnCallback(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('AllConfig', $mockConfig); $this->trashRoot1 = '/' . self::TEST_TRASHBIN_USER1 . '/files_trashbin'; |