diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-15 16:29:44 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-16 12:49:10 +0200 |
commit | f4ede27cdbbb4f55bb963130295a28a89a833d94 (patch) | |
tree | fefcca04d1fff7e897e13da0ac3fcc4bef70a3d4 /tests | |
parent | 69341e4306259430533cf66fd0a76688c7c8e6ab (diff) | |
download | nextcloud-server-f4ede27cdbbb4f55bb963130295a28a89a833d94.tar.gz nextcloud-server-f4ede27cdbbb4f55bb963130295a28a89a833d94.zip |
refactor: Remove deprecated `Util` function for filename validation to `FilenameValidator`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/UtilTest.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 82897cbca29..a83f27d5cf7 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -138,64 +138,6 @@ class UtilTest extends \Test\TestCase { } /** - * @dataProvider filenameValidationProvider - */ - public function testFilenameValidation($file, $valid) { - // private API - $this->assertEquals($valid, \OC_Util::isValidFileName($file)); - // public API - $this->assertEquals($valid, \OCP\Util::isValidFileName($file)); - } - - public function filenameValidationProvider() { - return [ - // valid names - ['boringname', true], - ['something.with.extension', true], - ['now with spaces', true], - ['.a', true], - ['..a', true], - ['.dotfile', true], - ['single\'quote', true], - [' spaces before', true], - ['spaces after ', true], - ['allowed chars including the crazy ones $%&_-^@!,()[]{}=;#', true], - ['汉字也能用', true], - ['und Ümläüte sind auch willkommen', true], - // disallowed names - ['', false], - [' ', false], - ['.', false], - ['..', false], - ['back\\slash', false], - ['sl/ash', false], - ['lt<lt', true], - ['gt>gt', true], - ['col:on', true], - ['double"quote', true], - ['pi|pe', true], - ['dont?ask?questions?', true], - ['super*star', true], - ['new\nline', false], - - // better disallow these to avoid unexpected trimming to have side effects - [' ..', false], - ['.. ', false], - ['. ', false], - [' .', false], - - // part files not allowed - ['.part', false], - ['notallowed.part', false], - ['neither.filepart', false], - - // part in the middle is ok - ['super movie part one.mkv', true], - ['super.movie.part.mkv', true], - ]; - } - - /** * Test needUpgrade() when the core version is increased */ public function testNeedUpgradeCore() { |