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:
* https://github.com/sebastianbergmann/phpunit/blob/9.1.5/ChangeLog-9.1.md#910---2020-04-03
* https://github.com/sebastianbergmann/phpunit/issues/4076

Follow-up to [51559-51563].

Props jrf.
See #46149.

git-svn-id: https://develop.svn.wordpress.org/trunk@51564 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-08-06 21:45:32 +00:00
parent fe7295b860
commit 29d678d08b
8 changed files with 11 additions and 11 deletions
@@ -76,13 +76,13 @@ if ( is_multisite() ) :
// The file on the main site should still exist. The file on the deleted site should not.
$this->assertFileExists( $file1['file'] );
$this->assertFileNotExists( $file2['file'] );
$this->assertFileDoesNotExist( $file2['file'] );
wpmu_delete_blog( $blog_id, true );
// The file on the main site should still exist. The file on the deleted site should not.
$this->assertFileExists( $file1['file'] );
$this->assertFileNotExists( $file2['file'] );
$this->assertFileDoesNotExist( $file2['file'] );
}
}
+2 -2
View File
@@ -391,13 +391,13 @@ if ( is_multisite() ) :
// The file on the main site should still exist. The file on the deleted site should not.
$this->assertFileExists( $file1['file'] );
$this->assertFileNotExists( $file2['file'] );
$this->assertFileDoesNotExist( $file2['file'] );
wpmu_delete_blog( $blog_id, true );
// The file on the main site should still exist. The file on the deleted site should not.
$this->assertFileExists( $file1['file'] );
$this->assertFileNotExists( $file2['file'] );
$this->assertFileDoesNotExist( $file2['file'] );
}
function test_wpmu_update_blogs_date() {