From 417119ceb2f7acf1d0d11050caa491847e01fd30 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Tue, 1 Jul 2025 09:53:53 +0200 Subject: [PATCH] Add test cases for some characters in the "space separator" category --- tests/phpunit/tests/formatting/sanitizeFileName.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/formatting/sanitizeFileName.php b/tests/phpunit/tests/formatting/sanitizeFileName.php index d0fac9e2326da..d0e366f121a5a 100644 --- a/tests/phpunit/tests/formatting/sanitizeFileName.php +++ b/tests/phpunit/tests/formatting/sanitizeFileName.php @@ -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', ); foreach ( $urls as $test => $expected ) {