Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/phpunit/tests/formatting/sanitizeFileName.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ public function test_removes_accents() {
* Test that spaces are correctly replaced with dashes.
*
* @ticket 16330
* @ticket 62995
*/
public function test_replaces_spaces() {
$urls = array(
'unencoded space.png' => 'unencoded-space.png',
'encoded-space.jpg' => 'encoded-space.jpg',
'plus+space.jpg' => 'plusspace.jpg',
'multi %20 +space.png' => 'multi-20-space.png',
'unencoded space.png' => 'unencoded-space.png',
'encoded-space.jpg' => 'encoded-space.jpg',
'plus+space.jpg' => 'plusspace.jpg',
'multi %20 +space.png' => 'multi-20-space.png',
"Screenshot 2025-02-19 at 2.17.33\u{202F}PM.png" => 'Screenshot-2025-02-19-at-2.17.33-PM.png',
"Filename with non-breaking\u{00A0}space.txt" => 'Filename-with-non-breaking-space.txt',
"Filename with thin\u{2009}space.txt" => 'Filename-with-thin-space.txt',
Comment on lines +42 to +48
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep this minimal. Ideally, this would be a data provider but that's best left for a follow-up.

3 different space space characters are handled as expected.

);

foreach ( $urls as $test => $expected ) {
Expand Down