summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/l10n/factorytest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/l10n/factorytest.php b/tests/lib/l10n/factorytest.php
index 1cdc094043b..f632e48e2de 100644
--- a/tests/lib/l10n/factorytest.php
+++ b/tests/lib/l10n/factorytest.php
@@ -137,6 +137,28 @@ class FactoryTest extends TestCase {
$this->restoreService('UserSession');
}
+ public function dataFindAvailableLanguages() {
+ return [
+ [null],
+ ['files'],
+ ];
+ }
+
+ /**
+ * @dataProvider dataFindAvailableLanguages
+ *
+ * @param string|null $app
+ */
+ public function testFindAvailableLanguages($app) {
+ $factory = $this->getFactory(['findL10nDir']);
+ $factory->expects($this->once())
+ ->method('findL10nDir')
+ ->with($app)
+ ->willReturn(\OC::$SERVERROOT . '/tests/data/l10n/');
+
+ $this->assertEquals(['cs', 'de', 'en', 'ru'], $factory->findAvailableLanguages($app), '', 0.0, 10, true);
+ }
+
public function dataLanguageExists() {
return [
[null, 'en', [], true],