From e50f13d46b285c4f74b13d4ad9107cedf23311f2 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 17 Mar 2015 18:16:28 +0100 Subject: [PATCH] Add positive test for path verification --- tests/lib/files/pathverificationtest.php | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/lib/files/pathverificationtest.php b/tests/lib/files/pathverificationtest.php index 5d38c6291a..65342c7799 100644 --- a/tests/lib/files/pathverificationtest.php +++ b/tests/lib/files/pathverificationtest.php @@ -230,4 +230,30 @@ class PathVerification extends \Test\TestCase { ]; } + /** + * @dataProvider providesValidPosixPaths + */ + public function testPathVerificationValidPaths($fileName) { + $storage = new Local(['datadir' => '']); + + \Test_Helper::invokePrivate($storage, 'verifyPosixPath', [$fileName]); + \Test_Helper::invokePrivate($storage, 'verifyWindowsPath', [$fileName]); + // nothing thrown + $this->assertTrue(true); + } + + public function providesValidPosixPaths() { + return [ + ['simple'], + ['simple.txt'], + ['\''], + ['`'], + ['%'], + ['()'], + ['[]'], + ['!'], + ['$'], + ['_'], + ]; + } }