Commit 5921c1ca authored by Krzysztof Domański's avatar Krzysztof Domański Committed by Krzysztof Domański
Browse files

Issue #3083382 by Krzysztof Domański: Add test coverage of sanitize the file name

parent ba0adf97
......@@ -45,7 +45,18 @@ class SanitizeNameTest extends UnitTestCase {
*/
public function providerSanitizeName() {
return [
// Transliterate Non-US-ASCII.
['ąęółżźćśń.pdf', 'aeolzzcsn.pdf'],
// Remove unknown unicodes.
[chr(0xF8) . chr(0x80) . chr(0x80) . '.txt', '.txt'],
// Force lowercase.
['LOWERCASE.txt', 'lowercase.txt'],
// Replace whitespace.
['test whitespace.txt', 'test-whitespace.txt'],
['test whitespace.txt', 'test-whitespace.txt'],
// Remove multiple consecutive non-alphabetical characters.
['---___.txt', '-_.txt'],
['-- --.txt', '-.txt'],
];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment