mirror of
https://github.com/filegator/filegator.git
synced 2025-08-09 10:26:38 +02:00
test for sanitizeFilename
This commit is contained in:
@@ -143,4 +143,14 @@ class TmpfsTest extends TestCase
|
||||
|
||||
$this->assertFileExists(TEST_TMP_PATH.'old.txt');
|
||||
}
|
||||
|
||||
public function testSanitizeFilename()
|
||||
{
|
||||
$this->assertEquals('test.txt', $this->invokeMethod($this->service, 'sanitizeFilename', ['test.txt']));
|
||||
$this->assertEquals('断及服务层流.txt', $this->invokeMethod($this->service, 'sanitizeFilename', ['断及服务层流.txt']));
|
||||
$this->assertEquals('ąčęėįšųū.txt', $this->invokeMethod($this->service, 'sanitizeFilename', ['ąčęėįšųū.txt']));
|
||||
|
||||
// remove invalid chars
|
||||
$this->assertEquals('..--s-u---pe----rm---an-.t-xt..--', $this->invokeMethod($this->service, 'sanitizeFilename', ["../\\s\"u<:>pe////rm?*|an\\.t\txt../;"]));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user