From a58e7e7ca8878607b94a22501916c57e3524769e Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Thu, 1 Apr 2021 20:39:56 +0000 Subject: [PATCH] Build/Test Tools: Cleanup `link-manager.zip` after REST API tests are finished. Introduced in [48242], the `link-manager` plugin is copied from `DIR_TESTDATA/plugins` to `DIR_TESTDATA` during the REST API unit tests, but was not cleaned up afterward. This created a "dirty" local working copy. This change `unlink`s the copied plugin from `DIR_TESTDATA` after unit tests are completed. Props johnbillion, TimothyBlynJacobs, desrosj, rachelbaker. Fixes #52579. git-svn-id: https://develop.svn.wordpress.org/trunk@50633 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-plugins-controller.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/phpunit/tests/rest-api/rest-plugins-controller.php b/tests/phpunit/tests/rest-api/rest-plugins-controller.php index 2448e274a2..3e2873f55c 100644 --- a/tests/phpunit/tests/rest-api/rest-plugins-controller.php +++ b/tests/phpunit/tests/rest-api/rest-plugins-controller.php @@ -86,6 +86,9 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase { if ( file_exists( WP_PLUGIN_DIR . '/test-plugin/test-plugin.php' ) ) { $this->rmdir( WP_PLUGIN_DIR . '/test-plugin' ); } + if ( file_exists( DIR_TESTDATA . '/link-manager.zip' ) ) { + unlink( DIR_TESTDATA . '/link-manager.zip' ); + } parent::tearDown(); }