diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-09-01 09:58:59 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-09-01 11:39:26 +0200 |
commit | ac8051ee0c8b6f8e484c71b874cdef60e7cfce74 (patch) | |
tree | 538b727b6989dd02c51be4536e94c629b14d9579 /apps/files_trashbin | |
parent | 2513b64602b291253813f6b83c6c52b2f50f2d0a (diff) | |
download | nextcloud-server-ac8051ee0c8b6f8e484c71b874cdef60e7cfce74.tar.gz nextcloud-server-ac8051ee0c8b6f8e484c71b874cdef60e7cfce74.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 | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 96a76e1e2fe..4835cb925cf 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -29,10 +29,10 @@ * */ -use OCA\Files_Sharing\AppInfo\Application; -use OCA\Files_Trashbin\AppInfo\Application as TrashbinApplication; use OC\AppFramework\Bootstrap\BootContext; use OC\AppFramework\DependencyInjection\DIContainer; +use OCA\Files_Sharing\AppInfo\Application; +use OCA\Files_Trashbin\AppInfo\Application as TrashbinApplication; use OCP\Share\IShare; /** @@ -124,15 +124,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'; |