diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-12-01 19:08:58 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-12-02 21:13:07 +0100 |
commit | 791d57051ad4d5fd6f24a0e8c200ca1fc8555c3e (patch) | |
tree | 58da45d4772351b19dbac50210b8150ace2256ed /tests | |
parent | 71a3528510f0ef6e640fae79b9e30f0e639b716e (diff) | |
download | nextcloud-server-791d57051ad4d5fd6f24a0e8c200ca1fc8555c3e.tar.gz nextcloud-server-791d57051ad4d5fd6f24a0e8c200ca1fc8555c3e.zip |
Adapt tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/UtilTest.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index ca7a4ad1442..1b430fd7ecd 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -225,30 +225,35 @@ class UtilTest extends \Test\TestCase { \OC_Util::$scripts = []; \OC_Util::$styles = []; + self::invokePrivate(\OCP\Util::class, 'scripts', [[]]); } protected function tearDown(): void { parent::tearDown(); \OC_Util::$scripts = []; \OC_Util::$styles = []; + self::invokePrivate(\OCP\Util::class, 'scripts', [[]]); } public function testAddScript() { - \OC_Util::addScript('core', 'myFancyJSFile1'); - \OC_Util::addScript('myApp', 'myFancyJSFile2'); - \OC_Util::addScript('core', 'myFancyJSFile0', true); - \OC_Util::addScript('core', 'myFancyJSFile10', true); + \OCP\Util::addScript('core', 'myFancyJSFile1'); + \OCP\Util::addScript('files', 'myFancyJSFile2', 'core'); + \OCP\Util::addScript('myApp', 'myFancyJSFile3'); + \OCP\Util::addScript('core', 'myFancyJSFile4'); + // after itself + \OCP\Util::addScript('core', 'myFancyJSFile5', 'core'); // add duplicate - \OC_Util::addScript('core', 'myFancyJSFile1'); + \OCP\Util::addScript('core', 'myFancyJSFile1'); $this->assertEquals([ - 'core/js/myFancyJSFile10', - 'core/js/myFancyJSFile0', 'core/js/myFancyJSFile1', + 'core/js/myFancyJSFile4', + 'files/js/myFancyJSFile2', + 'core/js/myFancyJSFile5', + 'files/l10n/en', 'myApp/l10n/en', - 'myApp/js/myFancyJSFile2', - ], \OC_Util::$scripts); - $this->assertEquals([], \OC_Util::$styles); + 'myApp/js/myFancyJSFile3', + ], array_values(\OCP\Util::getScripts())); } public function testAddVendorScript() { |