Skip to content

Commit f917e8b

Browse files
committed
Tests: Clean up attachments added during Tests_Ajax_wpAjaxSendAttachmentToEditor.
Tests in this class used to add attachments that weren't removed in the tear down class method. As such, following tests in other suites that ran after the ajax group were impacted. Specifically, when running `grunt precommit`, the test `WP_Test_REST_Attachments_Controller::test_sideload_scaled_unique_filename` in the multisite suite failed because it expected a filename `canola-scaled.jpg` and found `canola-scaled-1.jpg` instead. Props mukesh27, mosescursor, mohamedahamed, afercia. Fixes #65595. git-svn-id: https://develop.svn.wordpress.org/trunk@62709 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d6f6780 commit f917e8b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
*/
1414
class Tests_Ajax_wpAjaxSendAttachmentToEditor extends WP_Ajax_UnitTestCase {
1515

16+
/**
17+
* Tear down the test fixture.
18+
*/
19+
public function tear_down() {
20+
// Cleanup.
21+
$this->remove_added_uploads();
22+
parent::tear_down();
23+
}
24+
1625
/**
1726
* Shared user ID for the tests.
1827
*

0 commit comments

Comments
 (0)