summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-04-18 21:18:37 +0200
committerGitHub <noreply@github.com>2018-04-18 21:18:37 +0200
commita1c4bdfdf87a5fb4ac3722c5946d7ed595d1b9fb (patch)
treeb170a412aeef18d60d25dcdfb7c6a6dde29a75a1 /tests/lib
parentcbe03cb561bd4b6eb9b41fc81936524a248c8058 (diff)
parent5fbba7854b433e8b77ecb09edf0b804c233ae2aa (diff)
downloadnextcloud-server-a1c4bdfdf87a5fb4ac3722c5946d7ed595d1b9fb.tar.gz
nextcloud-server-a1c4bdfdf87a5fb4ac3722c5946d7ed595d1b9fb.zip
Merge pull request #9233 from nextcloud/13-9159
[stable13] fix appinfo parsing when a single localized option is provided
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/AppTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php
index 620e9344c43..03e7a70f7be 100644
--- a/tests/lib/AppTest.php
+++ b/tests/lib/AppTest.php
@@ -9,6 +9,7 @@
namespace Test;
+use OC\App\InfoParser;
use OC\AppConfig;
use OCP\IAppConfig;
@@ -605,5 +606,18 @@ class AppTest extends \Test\TestCase {
public function testParseAppInfo(array $data, array $expected) {
$this->assertSame($expected, \OC_App::parseAppInfo($data));
}
+
+ public function testParseAppInfoL10N() {
+ $parser = new InfoParser();
+ $data = $parser->parse(\OC::$SERVERROOT. "/tests/data/app/description-multi-lang.xml");
+ $this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']);
+ $this->assertEquals('German', \OC_App::parseAppInfo($data, 'de')['description']);
+ }
+
+ public function testParseAppInfoL10NSingleLanguage() {
+ $parser = new InfoParser();
+ $data = $parser->parse(\OC::$SERVERROOT. "/tests/data/app/description-single-lang.xml");
+ $this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']);
+ }
}