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.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/l10n/factorytest.php b/tests/lib/l10n/factorytest.php
index 9f5954d0ee1..228ec482fc9 100644
--- a/tests/lib/l10n/factorytest.php
+++ b/tests/lib/l10n/factorytest.php
@@ -287,6 +287,31 @@ class FactoryTest extends TestCase {
];
}
+ public function testFindAvailableLanguagesWithThemes() {
+ $serverRoot = \OC::$SERVERROOT;
+ \OC::$SERVERROOT = \OC::$SERVERROOT . '/tests/data';
+ $app = 'files';
+
+ $factory = $this->getFactory(['findL10nDir']);
+ $factory->expects($this->once())
+ ->method('findL10nDir')
+ ->with($app)
+ ->willReturn(\OC::$SERVERROOT . '/apps/files/l10n/');
+ $this->config
+ ->expects($this->once())
+ ->method('getSystemValue')
+ ->with('theme')
+ ->willReturn('abc');
+
+ try {
+ $this->assertEquals(['en', 'zz'], $factory->findAvailableLanguages($app), '', 0.0, 10, true);
+ } catch (\Exception $e) {
+ \OC::$SERVERROOT = $serverRoot;
+ throw $e;
+ }
+ \OC::$SERVERROOT = $serverRoot;
+ }
+
/**
* @dataProvider dataLanguageExists
*