From 95d11878b0d3ed89c05ae894754374620ffae1bd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 22 Nov 2022 20:17:08 +0000 Subject: [PATCH] Tests: Clean up test file in `wpmu_delete_blog()` tests. This makes sure there are no leftover files after the tests from the `multisite` directory are run separately. Follow-up to [30404]. See #56793. git-svn-id: https://develop.svn.wordpress.org/trunk@54864 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/multisite/msFilesRewriting.php | 2 ++ tests/phpunit/tests/multisite/site.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/phpunit/tests/multisite/msFilesRewriting.php b/tests/phpunit/tests/multisite/msFilesRewriting.php index 38818b5028..7d469769ba 100644 --- a/tests/phpunit/tests/multisite/msFilesRewriting.php +++ b/tests/phpunit/tests/multisite/msFilesRewriting.php @@ -72,6 +72,8 @@ 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->assertFileDoesNotExist( $file2['file'] ); + + unlink( $file1['file'] ); } } diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index 6507fbbf22..a3e179a88d 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -398,6 +398,8 @@ 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->assertFileDoesNotExist( $file2['file'] ); + + unlink( $file1['file'] ); } public function test_wpmu_update_blogs_date() {