Make WordPress Core

Changes between Initial Version and Version 4 of Ticket #55918


Ignore:
Timestamp:
06/04/2022 03:30:04 PM (3 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #55918

    • Property Keywords has-unit-tests added
  • Ticket #55918 – Description

    initial v4  
    3232However, at present, that would not work as expected: by the time `wp_delete_attachment()` runs, the attachment ID is no longer in the database, so it returns early, leaving some files in the `uploads` directory. This was previously tangentially noted in comment:6:ticket:38264.
    3333
    34 By calling `wpTearDownAfterClass()` in `tear_down_after_class()` before deleting all data, instead of after, we can make sure both of these methods have access to the same data and can peform cleanup as necessary.
     34By calling `wpTearDownAfterClass()` in `WP_UnitTestCase_Base::tear_down_after_class()` before deleting all data, instead of after, we can make sure both of these methods have access to the same data and can peform cleanup as necessary.
    3535
    3636As a potential further enhancement, we could standardize on `wpSetUpBeforeClass()` / `wpTearDownAfterClass()` across the test suite for consistency, as these are already used in the majority of tests.