aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/App/AppManagerTest.php58
1 files changed, 56 insertions, 2 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php
index 73ac7b79909..104b0941644 100644
--- a/tests/lib/App/AppManagerTest.php
+++ b/tests/lib/App/AppManagerTest.php
@@ -609,20 +609,47 @@ class AppManagerTest extends TestCase {
'',
'',
'{}',
+ 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
@@ -630,13 +657,31 @@ class AppManagerTest extends TestCase {
'unexist,settings',
'',
'{}',
+ true,
'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":[1],"files":[2]}',
+ true,
'files',
],
// user-customized apporder fallback
@@ -644,15 +689,24 @@ class AppManagerTest extends TestCase {
'',
'',
'{"settings":[1],"files":[2]}',
+ true,
'settings',
],
+ // user-customized apporder, but called without fallback
+ [
+ '',
+ '',
+ '{"settings":[1],"files":[2]}',
+ false,
+ '',
+ ],
];
}
/**
* @dataProvider provideDefaultApps
*/
- public function testGetDefaultAppForUser($defaultApps, $userDefaultApps, $userApporder, $expectedApp) {
+ public function testGetDefaultAppForUser($defaultApps, $userDefaultApps, $userApporder, $withFallbacks, $expectedApp) {
$user = $this->newUser('user1');
$this->userSession->expects($this->once())
@@ -671,6 +725,6 @@ class AppManagerTest extends TestCase {
['user1', 'core', 'apporder', '[]', $userApporder],
]);
- $this->assertEquals($expectedApp, $this->manager->getDefaultAppForUser());
+ $this->assertEquals($expectedApp, $this->manager->getDefaultAppForUser(null, $withFallbacks));
}
}