Make WordPress Core

Changeset 62709


Ignore:
Timestamp:
07/13/2026 10:38:43 AM (4 weeks ago)
Author:
afercia
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php

    r60253 r62709  
    1313 */
    1414class Tests_Ajax_wpAjaxSendAttachmentToEditor extends WP_Ajax_UnitTestCase {
     15
     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        }
    1524
    1625        /**
Note: See TracChangeset for help on using the changeset viewer.