diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-03-17 18:16:28 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-03-17 18:17:30 +0100 |
commit | e50f13d46b285c4f74b13d4ad9107cedf23311f2 (patch) | |
tree | faa47152e047e68403a74fe6653d6e58ee87807d /tests/lib | |
parent | c3ae01d66f46321ab79fa0a69597068e12ae72cb (diff) | |
download | nextcloud-server-e50f13d46b285c4f74b13d4ad9107cedf23311f2.tar.gz nextcloud-server-e50f13d46b285c4f74b13d4ad9107cedf23311f2.zip |
Add positive test for path verification
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/files/pathverificationtest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/lib/files/pathverificationtest.php b/tests/lib/files/pathverificationtest.php index 5d38c6291a6..65342c7799e 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'], + ['\''], + ['`'], + ['%'], + ['()'], + ['[]'], + ['!'], + ['$'], + ['_'], + ]; + } } |