diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-18 10:00:29 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-26 14:02:32 +0100 |
commit | f413b3ff3a7d4be4e8e4072c354ea3228f4110d5 (patch) | |
tree | 9ba7807f088ef956fc2261f31fa4052ce718bcbe /tests/lib | |
parent | 70396581eb4c33b380962d4589ce183f01dfc090 (diff) | |
download | nextcloud-server-f413b3ff3a7d4be4e8e4072c354ea3228f4110d5.tar.gz nextcloud-server-f413b3ff3a7d4be4e8e4072c354ea3228f4110d5.zip |
Add tests for findAvailableLanguages
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/l10n/factorytest.php | 22 |
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], |