diff options
author | Robin Appelman <robin@icewind.nl> | 2018-04-12 12:28:25 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-04-17 11:14:03 +0200 |
commit | 46d0d0cda14df17df3392e8233388d54e0be97dd (patch) | |
tree | 94407f8e2a7209a2cc8a2306c14ce55f3e343640 /tests/lib/AppTest.php | |
parent | 63dfbb2127ec9a930778dd5d31b640c5f2cc3652 (diff) | |
download | nextcloud-server-46d0d0cda14df17df3392e8233388d54e0be97dd.tar.gz nextcloud-server-46d0d0cda14df17df3392e8233388d54e0be97dd.zip |
fix appinfo parsing when a single localized option is provided
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/AppTest.php')
-rw-r--r-- | tests/lib/AppTest.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php index 04729303847..1334aa62f13 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; @@ -592,5 +593,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']); + } } |