aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/l10n/factorytest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/l10n/factorytest.php')
-rw-r--r--tests/lib/l10n/factorytest.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/lib/l10n/factorytest.php b/tests/lib/l10n/factorytest.php
index 9f5954d0ee1..e4c0eab2e6a 100644
--- a/tests/lib/l10n/factorytest.php
+++ b/tests/lib/l10n/factorytest.php
@@ -28,6 +28,9 @@ class FactoryTest extends TestCase {
/** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject */
protected $userSession;
+ /** @var string */
+ protected $serverRoot;
+
public function setUp() {
parent::setUp();
@@ -42,6 +45,8 @@ class FactoryTest extends TestCase {
->getMock();
$this->userSession = $this->getMock('\OCP\IUserSession');
+
+ $this->serverRoot = \OC::$SERVERROOT;
}
/**
@@ -54,12 +59,13 @@ class FactoryTest extends TestCase {
->setConstructorArgs([
$this->config,
$this->request,
- $this->userSession
+ $this->userSession,
+ $this->serverRoot,
])
->setMethods($methods)
->getMock();
} else {
- return new Factory($this->config, $this->request, $this->userSession);
+ return new Factory($this->config, $this->request, $this->userSession, $this->serverRoot);
}
}
@@ -287,6 +293,24 @@ class FactoryTest extends TestCase {
];
}
+ public function testFindAvailableLanguagesWithThemes() {
+ $this->serverRoot .= '/tests/data';
+ $app = 'files';
+
+ $factory = $this->getFactory(['findL10nDir']);
+ $factory->expects($this->once())
+ ->method('findL10nDir')
+ ->with($app)
+ ->willReturn($this->serverRoot . '/apps/files/l10n/');
+ $this->config
+ ->expects($this->once())
+ ->method('getSystemValue')
+ ->with('theme')
+ ->willReturn('abc');
+
+ $this->assertEquals(['en', 'zz'], $factory->findAvailableLanguages($app), '', 0.0, 10, true);
+ }
+
/**
* @dataProvider dataLanguageExists
*