diff options
author | provokateurin <kate@provokateurin.de> | 2024-08-27 12:14:09 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-09-09 11:04:36 +0200 |
commit | 70ed08daf1d6845af5df3a4a0b06eb73d190c6cf (patch) | |
tree | 4537190b9b1a700e0ce819d80c19ac4c693b3796 /tests/lib/App | |
parent | b0baaaed9dfdce8c2630255d0d1921679579761d (diff) | |
download | nextcloud-server-70ed08daf1d6845af5df3a4a0b06eb73d190c6cf.tar.gz nextcloud-server-70ed08daf1d6845af5df3a4a0b06eb73d190c6cf.zip |
refactor(AppManager): Deprecated default apps handling
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'tests/lib/App')
-rw-r--r-- | tests/lib/App/AppManagerTest.php | 153 |
1 files changed, 0 insertions, 153 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 03c9d474c55..82a3f0d2045 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -733,159 +733,6 @@ class AppManagerTest extends TestCase { $this->assertEquals(['foo'], $this->manager->getAppRestriction('test3')); } - public function provideDefaultApps(): array { - return [ - // none specified, default to files - [ - '', - '', - '{}', - true, - 'files', - ], - // none specified, without fallback - [ - '', - '', - '{}', - false, - '', - ], - // unexisting or inaccessible app specified, default to files - [ - 'unexist', - '', - '{}', - true, - 'files', - ], - // unexisting or inaccessible app specified, without fallbacks - [ - 'unexist', - '', - '{}', - false, - '', - ], - // non-standard app - [ - 'settings', - '', - '{}', - true, - 'settings', - ], - // non-standard app, without fallback - [ - 'settings', - '', - '{}', - false, - 'settings', - ], - // non-standard app with fallback - [ - 'unexist,settings', - '', - '{}', - true, - 'settings', - ], - // system default app and user apporder - [ - // system default is settings - 'unexist,settings', - '', - // apporder says default app is files (order is lower) - '{"files_id":{"app":"files","order":1},"settings_id":{"app":"settings","order":2}}', - true, - // system default should override apporder - 'settings' - ], - // user-customized defaultapp - [ - '', - 'files', - '', - true, - 'files', - ], - // user-customized defaultapp with systemwide - [ - 'unexist,settings', - 'files', - '', - true, - 'files', - ], - // user-customized defaultapp with system wide and apporder - [ - 'unexist,settings', - 'files', - '{"settings_id":{"app":"settings","order":1},"files_id":{"app":"files","order":2}}', - true, - 'files', - ], - // user-customized apporder fallback - [ - '', - '', - '{"settings_id":{"app":"settings","order":1},"files":{"app":"files","order":2}}', - true, - 'settings', - ], - // user-customized apporder fallback with missing app key (entries added by closures does not always have an app key set (Nextcloud 27 spreed app for example)) - [ - '', - '', - '{"spreed":{"order":1},"files":{"app":"files","order":2}}', - true, - 'files', - ], - // user-customized apporder, but called without fallback - [ - '', - '', - '{"settings":{"app":"settings","order":1},"files":{"app":"files","order":2}}', - false, - '', - ], - // user-customized apporder with an app that has multiple routes - [ - '', - '', - '{"settings_id":{"app":"settings","order":1},"settings_id_2":{"app":"settings","order":3},"id_files":{"app":"files","order":2}}', - true, - 'settings', - ], - ]; - } - - /** - * @dataProvider provideDefaultApps - */ - public function testGetDefaultAppForUser($defaultApps, $userDefaultApps, $userApporder, $withFallbacks, $expectedApp) { - $user = $this->newUser('user1'); - - $this->userSession->expects($this->once()) - ->method('getUser') - ->willReturn($user); - - $this->config->expects($this->once()) - ->method('getSystemValueString') - ->with('defaultapp', $this->anything()) - ->willReturn($defaultApps); - - $this->config->expects($this->atLeastOnce()) - ->method('getUserValue') - ->willReturnMap([ - ['user1', 'core', 'defaultapp', '', $userDefaultApps], - ['user1', 'core', 'apporder', '[]', $userApporder], - ]); - - $this->assertEquals($expectedApp, $this->manager->getDefaultAppForUser(null, $withFallbacks)); - } - public static function isBackendRequiredDataProvider(): array { return [ // backend available |