Make WordPress Core

Ticket #21453: 21453.patch

File 21453.patch, 943 bytes (added by tyxla, 9 years ago)

Altering Tests_Functions::test_wp_unique_filename() to support the hyphen prefix when creating unique filenames

  • tests/phpunit/tests/functions.php

     
    146146
    147147                // check number is appended for file already exists
    148148                $this->assertFileExists( $testdir . 'test-image.png', 'Test image does not exist' );
    149                 $this->assertEquals( 'test-image1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
    150                 $this->assertFileNotExists( $testdir . 'test-image1.png' );
     149                $this->assertEquals( 'test-image-1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
     150                $this->assertFileNotExists( $testdir . 'test-image-1.png' );
    151151
    152152                // check special chars
    153153                $this->assertEquals( 'testtést-imagé.png', wp_unique_filename( $testdir, 'testtést-imagé.png' ), 'Filename with special chars failed' );