mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
chore(trashbin): Fix configuration mocking in trashbin tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
14872c8040
commit
561b590c77
1 changed files with 5 additions and 12 deletions
|
|
@ -115,8 +115,11 @@ class TrashbinTest extends \Test\TestCase {
|
|||
|
||||
Server::get(IAppManager::class)->enableApp('files_trashbin');
|
||||
$config = Server::get(IConfig::class);
|
||||
$mockConfig = $this->createMock(IConfig::class);
|
||||
$mockConfig
|
||||
$mockConfig = $this->getMockBuilder(AllConfig::class)
|
||||
->onlyMethods(['getSystemValue'])
|
||||
->setConstructorArgs([Server::get(\OC\SystemConfig::class)])
|
||||
->getMock();
|
||||
$mockConfig->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->willReturnCallback(static function ($key, $default) use ($config) {
|
||||
if ($key === 'filesystem_check_changes') {
|
||||
|
|
@ -125,16 +128,6 @@ class TrashbinTest extends \Test\TestCase {
|
|||
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::class, $mockConfig);
|
||||
|
||||
$this->trashRoot1 = '/' . self::TEST_TRASHBIN_USER1 . '/files_trashbin';
|
||||
|
|
|
|||
Loading…
Reference in a new issue