summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-11-17 10:34:43 +0100
committerJulius Härtl <jus@bitgrid.net>2022-12-07 22:32:06 +0100
commit306d7829b58cc840e2e6fcb6d4dfd341da37547a (patch)
tree205686eea1ce207dcd8ed0ec0cddad668685ec93 /tests
parentbe4c061b754df917c02bf111b1a15e3c1062b4b8 (diff)
downloadnextcloud-server-306d7829b58cc840e2e6fcb6d4dfd341da37547a.tar.gz
nextcloud-server-306d7829b58cc840e2e6fcb6d4dfd341da37547a.zip
Cache available languages locally
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/L10N/FactoryTest.php8
-rw-r--r--tests/lib/L10N/L10nTest.php4
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php
index 4e01602a4f7..7af069cbff3 100644
--- a/tests/lib/L10N/FactoryTest.php
+++ b/tests/lib/L10N/FactoryTest.php
@@ -13,6 +13,7 @@ namespace Test\L10N;
use OC\L10N\Factory;
use OC\L10N\LanguageNotFoundException;
+use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IUser;
@@ -32,6 +33,9 @@ class FactoryTest extends TestCase {
/** @var IUserSession|MockObject */
protected $userSession;
+ /** @var ICacheFactory|MockObject */
+ protected $cacheFactory;
+
/** @var string */
protected $serverRoot;
@@ -41,6 +45,7 @@ class FactoryTest extends TestCase {
$this->config = $this->createMock(IConfig::class);
$this->request = $this->createMock(IRequest::class);
$this->userSession = $this->createMock(IUserSession::class);
+ $this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->serverRoot = \OC::$SERVERROOT;
}
@@ -64,13 +69,14 @@ class FactoryTest extends TestCase {
$this->config,
$this->request,
$this->userSession,
+ $this->cacheFactory,
$this->serverRoot,
])
->setMethods($methods)
->getMock();
}
- return new Factory($this->config, $this->request, $this->userSession, $this->serverRoot);
+ return new Factory($this->config, $this->request, $this->userSession, $this->cacheFactory, $this->serverRoot);
}
public function dataFindAvailableLanguages(): array {
diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php
index f410c523c05..f224592432c 100644
--- a/tests/lib/L10N/L10nTest.php
+++ b/tests/lib/L10N/L10nTest.php
@@ -11,6 +11,7 @@ namespace Test\L10N;
use DateTime;
use OC\L10N\Factory;
use OC\L10N\L10N;
+use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IUserSession;
@@ -32,7 +33,8 @@ class L10nTest extends TestCase {
$request = $this->createMock(IRequest::class);
/** @var IUserSession $userSession */
$userSession = $this->createMock(IUserSession::class);
- return new Factory($config, $request, $userSession, \OC::$SERVERROOT);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
+ return new Factory($config, $request, $userSession, $cacheFactory, \OC::$SERVERROOT);
}
public function testSimpleTranslationWithTrailingColon(): void {