summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-01-13 14:48:30 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-01-14 13:58:31 +0100
commit520d8ec53b672e768e59eaf0409559bbecc6c042 (patch)
treece2071bc2315cfbd160fa4d3e9347bd1ee21471d /tests
parentba8c050d2b827804d0c860be19591c9d35fd0adf (diff)
downloadnextcloud-server-520d8ec53b672e768e59eaf0409559bbecc6c042.tar.gz
nextcloud-server-520d8ec53b672e768e59eaf0409559bbecc6c042.zip
OC_App::parseAppInfo
* replace line breaks (on non empty lines) in the app description by spaces * fixes #13315 * includes unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/app.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/lib/app.php b/tests/lib/app.php
index 23c1a340e03..529de82e670 100644
--- a/tests/lib/app.php
+++ b/tests/lib/app.php
@@ -459,5 +459,34 @@ class Test_App extends \Test\TestCase {
// Remove the cache of the mocked apps list with a forceRefresh
\OC_App::getEnabledApps(true);
}
+
+ /**
+ * Providers for the app data values
+ */
+ function appDataProvider() {
+ return [
+ [
+ ['description' => " \t This is a multiline \n test with \n \t \n \n some new lines "],
+ ['description' => "This is a multiline test with\n\nsome new lines"]
+ ],
+ [
+ ['description' => " \t This is a multiline \n test with \n \t some new lines "],
+ ['description' => "This is a multiline test with some new lines"]
+ ],
+ [
+ ['not-a-description' => " \t This is a multiline \n test with \n \t some new lines "],
+ ['not-a-description' => " \t This is a multiline \n test with \n \t some new lines "]
+ ],
+ ];
+ }
+
+ /**
+ * Test app info parser
+ *
+ * @dataProvider appDataProvider
+ */
+ public function testParseAppInfo($data, $expected) {
+ $this->assertEquals($expected, \OC_App::parseAppInfo($data));
+ }
}