- Timestamp:
- 04/29/2020 04:53:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0/tests/phpunit/tests/formatting/SanitizeFileName.php
r37819 r47659 61 61 $this->assertEquals( 'no-extension', sanitize_file_name( '_.no-extension' ) ); 62 62 } 63 64 /** 65 * @dataProvider data_wp_filenames 66 */ 67 function test_replaces_invalid_utf8_characters( $input, $expected ) { 68 $this->assertEquals( $expected, sanitize_file_name( $input ) ); 69 } 70 71 function data_wp_filenames() { 72 return array( 73 array( urldecode( '%B1myfile.png' ), 'myfile.png' ), 74 array( urldecode( '%B1myfile' ), 'myfile' ), 75 array( 'demo bar.png', 'demo-bar.png' ), 76 array( 'demo' . json_decode( '"\u00a0"' ) . 'bar.png', 'demo-bar.png' ), 77 ); 78 } 63 79 }
Note: See TracChangeset
for help on using the changeset viewer.