- Timestamp:
- 04/29/2020 03:38:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/SanitizeFileName.php
r46586 r47638 69 69 $this->assertEquals( 'no-extension', sanitize_file_name( '_.no-extension' ) ); 70 70 } 71 72 /** 73 * @dataProvider data_wp_filenames 74 */ 75 function test_replaces_invalid_utf8_characters( $input, $expected ) { 76 $this->assertEquals( $expected, sanitize_file_name( $input ) ); 77 } 78 79 function data_wp_filenames() { 80 return array( 81 [ urldecode( '%B1myfile.png' ), 'myfile.png' ], 82 [ urldecode( '%B1myfile' ), 'myfile' ], 83 [ 'demo bar.png', 'demo-bar.png' ], 84 [ 'demo' . json_decode( '"\u00a0"' ) . 'bar.png', 'demo-bar.png' ], 85 ); 86 } 71 87 }
Note: See TracChangeset
for help on using the changeset viewer.