summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2023-05-12 10:47:46 +0200
committerGitHub <noreply@github.com>2023-05-12 10:47:46 +0200
commit174c226c28fbedacbe6c83ee6e8979b2eaa74ce1 (patch)
treed1e29fa4b621463c53a91051137785a703b5e39b /tests
parent0d3df2c795ad1ae1222c1b3408fe02b7e2e1e1bf (diff)
parent31c01fa3da094897d2bffbbf2bd4848773c62c67 (diff)
downloadnextcloud-server-174c226c28fbedacbe6c83ee6e8979b2eaa74ce1.tar.gz
nextcloud-server-174c226c28fbedacbe6c83ee6e8979b2eaa74ce1.zip
Merge pull request #38207 from nextcloud/fix/jsresourcelocator-l10n-handling
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Template/JSResourceLocatorTest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php
index 9ac6a32e22c..f5af138060a 100644
--- a/tests/lib/Template/JSResourceLocatorTest.php
+++ b/tests/lib/Template/JSResourceLocatorTest.php
@@ -26,6 +26,7 @@ namespace Test\Template;
use OC\SystemConfig;
use OC\Template\JSCombiner;
use OC\Template\JSResourceLocator;
+use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\Files\IAppData;
use OCP\ICacheFactory;
@@ -139,6 +140,27 @@ class JSResourceLocatorTest extends \Test\TestCase {
$this->rrmdir($new_apps_path);
}
+ public function testNotExistingTranslationHandledSilent() {
+ $this->appManager->expects($this->once())
+ ->method('getAppPath')
+ ->with('core')
+ ->willThrowException(new AppPathNotFoundException());
+ $this->appManager->expects($this->once())
+ ->method('getAppWebPath')
+ ->with('core')
+ ->willThrowException(new AppPathNotFoundException());
+ // Assert logger is not called
+ $this->logger->expects($this->never())
+ ->method('error');
+
+ // Run the tests
+ $locator = $this->jsResourceLocator();
+ $locator->find(["core/l10n/en.js"]);
+
+ $resources = $locator->getResources();
+ $this->assertCount(0, $resources);
+ }
+
public function testFindModuleJSWithFallback() {
// First create new apps path, and a symlink to it
$apps_dirname = $this->randomString();