summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-03-04 14:37:41 +0100
committerGitHub <noreply@github.com>2022-03-04 14:37:41 +0100
commit821a0dc87594c717e785027b81134bf8783913c9 (patch)
tree3b94ed75bc6b0478652d97463b68ad49c3a4fd1b /tests
parent8a52591335f9fc8ac06002dea17705f860487b09 (diff)
parent58d516b5095150a585cdeddcbbc8ea98133e07ec (diff)
downloadnextcloud-server-821a0dc87594c717e785027b81134bf8783913c9.tar.gz
nextcloud-server-821a0dc87594c717e785027b81134bf8783913c9.zip
Merge pull request #31387 from nextcloud/fix/common-main-core-script-order
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/UtilTest.php39
1 files changed, 30 insertions, 9 deletions
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php
index aeb53a600d9..568f535e557 100644
--- a/tests/lib/UtilTest.php
+++ b/tests/lib/UtilTest.php
@@ -252,16 +252,26 @@ class UtilTest extends \Test\TestCase {
\OCP\Util::addScript('myApp4', 'myApp4JSFile', 'myApp3');
\OCP\Util::addScript('myApp3', 'myApp3JSFile', 'myApp2');
\OCP\Util::addScript('myApp2', 'myApp2JSFile', 'myApp');
+ \OCP\Util::addScript('core', 'common');
+ \OCP\Util::addScript('core', 'main');
$scripts = \OCP\Util::getScripts();
// Core should appear first
$this->assertEquals(
0,
- array_search('core/js/myFancyJSFile1', $scripts, true)
+ array_search('core/js/common', $scripts, true)
);
$this->assertEquals(
1,
+ array_search('core/js/main', $scripts, true)
+ );
+ $this->assertEquals(
+ 2,
+ array_search('core/js/myFancyJSFile1', $scripts, true)
+ );
+ $this->assertEquals(
+ 3,
array_search('core/js/myFancyJSFile4', $scripts, true)
);
@@ -295,14 +305,25 @@ class UtilTest extends \Test\TestCase {
// All scripts still there
$scripts = [
- 'core/js/myFancyJSFile1',
- 'core/js/myFancyJSFile4',
- 'files/js/myFancyJSFile2',
- 'core/js/myFancyJSFile5',
- 'myApp/js/myFancyJSFile3',
- 'myApp2/js/myApp2JSFile',
- 'myApp3/js/myApp3JSFile',
- 'myApp4/js/myApp4JSFile',
+ "core/js/common",
+ "core/js/main",
+ "core/js/myFancyJSFile1",
+ "core/js/myFancyJSFile4",
+ "core/js/myFancyJSFile5",
+ "first/l10n/en",
+ "first/js/myFirstJSFile",
+ "files/l10n/en",
+ "files/js/myFancyJSFile2",
+ "myApp/l10n/en",
+ "myApp/js/myFancyJSFile3",
+ "myApp2/l10n/en",
+ "myApp2/js/myApp2JSFile",
+ "myApp5/l10n/en",
+ "myApp5/js/myApp5JSFile",
+ "myApp3/l10n/en",
+ "myApp3/js/myApp3JSFile",
+ "myApp4/l10n/en",
+ "myApp4/js/myApp4JSFile",
];
foreach ($scripts as $script) {
$this->assertContains($script, $scripts);