diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-13 14:48:30 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-14 13:58:31 +0100 |
commit | 520d8ec53b672e768e59eaf0409559bbecc6c042 (patch) | |
tree | ce2071bc2315cfbd160fa4d3e9347bd1ee21471d /tests | |
parent | ba8c050d2b827804d0c860be19591c9d35fd0adf (diff) | |
download | nextcloud-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.php | 29 |
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)); + } } |