aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-11-09 16:41:21 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2023-11-14 20:04:48 +0100
commit927e7fcf67e4e1216e1551160919cd018f12b963 (patch)
treeaaa1e1ddda2919a26986fc7495730aa160b1ca00 /tests
parent54a3012a111a5370a7e072d8ab5ff54c5707af60 (diff)
downloadnextcloud-server-927e7fcf67e4e1216e1551160919cd018f12b963.tar.gz
nextcloud-server-927e7fcf67e4e1216e1551160919cd018f12b963.zip
fix(AppManager): Ensure that app manager can handle empty app keys on the navigation entries
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/App/AppManagerTest.php31
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php
index 410bfa287fc..3733d6cd2e9 100644
--- a/tests/lib/App/AppManagerTest.php
+++ b/tests/lib/App/AppManagerTest.php
@@ -660,6 +660,17 @@ class AppManagerTest extends TestCase {
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
[
'',
@@ -680,7 +691,7 @@ class AppManagerTest extends TestCase {
[
'unexist,settings',
'files',
- '{"settings":{"app":"settings","order":1},"files":{"app":"files","order":2}}',
+ '{"settings_id":{"app":"settings","order":1},"files_id":{"app":"files","order":2}}',
true,
'files',
],
@@ -688,10 +699,18 @@ class AppManagerTest extends TestCase {
[
'',
'',
- '{"settings":{"app":"settings","order":1},"files":{"app":"files","order":2}}',
+ '{"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
[
'',
@@ -700,6 +719,14 @@ class AppManagerTest extends TestCase {
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',
+ ],
];
}