aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Template/JSResourceLocatorTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Template/JSResourceLocatorTest.php')
-rw-r--r--tests/lib/Template/JSResourceLocatorTest.php38
1 files changed, 11 insertions, 27 deletions
diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php
index f5af138060a..89ab8e66dd7 100644
--- a/tests/lib/Template/JSResourceLocatorTest.php
+++ b/tests/lib/Template/JSResourceLocatorTest.php
@@ -1,24 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2017 Kyle Fazzari <kyrofa@ubuntu.com>
- *
- * @author Kyle Fazzari <kyrofa@ubuntu.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Template;
@@ -89,7 +73,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
return sha1(uniqid(mt_rand(), true));
}
- public function testFindWithAppPathSymlink() {
+ public function testFindWithAppPathSymlink(): void {
$appName = 'test-js-app';
// First create new apps path, and a symlink to it
@@ -127,9 +111,9 @@ class JSResourceLocatorTest extends \Test\TestCase {
$webRoot = $resource[1];
$file = $resource[2];
- $expectedRoot = $new_apps_path . '/test-js-app';
- $expectedWebRoot = \OC::$WEBROOT . '/js-apps-test/test-js-app';
- $expectedFile = 'test-file.js';
+ $expectedRoot = $new_apps_path;
+ $expectedWebRoot = \OC::$WEBROOT . '/js-apps-test';
+ $expectedFile = $appName . '/test-file.js';
$this->assertEquals($expectedRoot, $root,
'Ensure the app path symlink is resolved into the real path');
@@ -140,12 +124,12 @@ class JSResourceLocatorTest extends \Test\TestCase {
$this->rrmdir($new_apps_path);
}
- public function testNotExistingTranslationHandledSilent() {
+ public function testNotExistingTranslationHandledSilent(): void {
$this->appManager->expects($this->once())
->method('getAppPath')
->with('core')
->willThrowException(new AppPathNotFoundException());
- $this->appManager->expects($this->once())
+ $this->appManager->expects($this->atMost(1))
->method('getAppWebPath')
->with('core')
->willThrowException(new AppPathNotFoundException());
@@ -155,13 +139,13 @@ class JSResourceLocatorTest extends \Test\TestCase {
// Run the tests
$locator = $this->jsResourceLocator();
- $locator->find(["core/l10n/en.js"]);
+ $locator->find(['core/l10n/en.js']);
$resources = $locator->getResources();
$this->assertCount(0, $resources);
}
- public function testFindModuleJSWithFallback() {
+ public function testFindModuleJSWithFallback(): void {
// First create new apps path, and a symlink to it
$apps_dirname = $this->randomString();
$new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname;