WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/06/2021 09:45:32 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Tests: Replace assertFileNotExists() with assertFileDoesNotExist().

The assertFileNotExists() method was hard deprecated in PHPUnit 9.1 and the functionality will be removed in PHPUnit 10.0.

The assertFileDoesNotExist() method was introduced as a replacement in PHPUnit 9.1.

This new PHPUnit method is polyfilled by the PHPUnit Polyfills and switching to it will future-proof the tests some more.

References:

Follow-up to [51559-51563].

Props jrf.
See #46149.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions.php

    r51537 r51564  
    174174        $this->assertFileExists( $testdir . 'test-image.png', 'Test image does not exist' );
    175175        $this->assertSame( 'test-image-1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
    176         $this->assertFileNotExists( $testdir . 'test-image-1.png' );
     176        $this->assertFileDoesNotExist( $testdir . 'test-image-1.png' );
    177177
    178178        // Check special chars.
Note: See TracChangeset for help on using the changeset viewer.