mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Formatting: when making unique filenames in wp_unique_filename() by adding an incrementing number, prefix it with a dash to disambiguate from files that end in numbers.
Updates unit tests. Props mikejolley, tyxla. Fixes #21453. git-svn-id: https://develop.svn.wordpress.org/trunk@35276 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -146,8 +146,8 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
|
||||
// check number is appended for file already exists
|
||||
$this->assertFileExists( $testdir . 'test-image.png', 'Test image does not exist' );
|
||||
$this->assertEquals( 'test-image1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
|
||||
$this->assertFileNotExists( $testdir . 'test-image1.png' );
|
||||
$this->assertEquals( 'test-image-1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
|
||||
$this->assertFileNotExists( $testdir . 'test-image-1.png' );
|
||||
|
||||
// check special chars
|
||||
$this->assertEquals( 'testtést-imagé.png', wp_unique_filename( $testdir, 'testtést-imagé.png' ), 'Filename with special chars failed' );
|
||||
|
||||
Reference in New Issue
Block a user