ILIAS  release_8 Revision v8.24
FilenameSanitizing.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Filesystem\Util;
20
21use PHPUnit\Framework\TestCase;
23
27class FilenameSanitizing extends TestCase
28{
29 public function provideFilenames(): array
30 {
31 return [
32 ["Control\u{00a0}Character", 'ControlCharacter'],
33 ["Soft\u{00ad}Hyphen", 'SoftHyphen'],
34 ["No\u{0083}Break", 'NoBreak'],
35 ["ZeroWidth\u{200C}NonJoiner", 'ZeroWidthNonJoiner'],
36 ["ZeroWidth\u{200d}Joiner", 'ZeroWidthJoiner'],
37 ["Invisible\u{2062}Times", 'InvisibleTimes'],
38 ["Invisible\u{2063}Comma", 'InvisibleComma'],
39 ["Funky\u{200B}Whitespace", 'FunkyWhitespace'],
40 ];
41 }
42
46 public function testSanitize(string $filename, string $expected): void
47 {
48 $this->assertEquals($expected, Util::sanitizeFilename($filename));
49 }
50}
$filename
Definition: buildRTE.php:78
testSanitize(string $filename, string $expected)
@dataProvider provideFilenames
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...