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
This commit is contained in:
David Baumwald
2021-04-01 20:39:56 +00:00
parent 22e2fce903
commit a58e7e7ca8

View File

@@ -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();
}