Changes between Initial Version and Version 4 of Ticket #55918
- Timestamp:
- 06/04/2022 03:30:04 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #55918
- Property Keywords has-unit-tests added
-
Ticket #55918 – Description
initial v4 32 32 However, 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. 33 33 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.34 By 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. 35 35 36 36 As 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.