Opened 7 years ago
Last modified 5 years ago
#42990 new enhancement
Deprecate WP_UnitTestCase::_make_attachment
Reported by: | Frank Klein | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch needs-refresh |
Focuses: | Cc: |
Description
In r35309, several ways of creating an attachment for an uploaded media file were consolidated into a single method, WP_UnitTestCase::_make_attachment
.
As part of r34855, a new method, create_upload_object
, was added to WP_UnitTest_Factory_For_Attachment
. It contains all of the code from _make_attachment
, but additionally it also handles the upload of the media file.
We should deprecate the _make_attachment
helper method, and use the factory method instead. This reduces duplicate code, and makes the interface of WP_UnitTestCase
cleaner.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Hi @frank-klein,
Thanks for this one! Sorry it took so long to receive a response.
Thinking this through, I think it would be best to ensure
create_upload_object
is used consistently in Core as a first step and then consider deprecatingWP_UnitTestCase::_make_attachment
.I also just went to apply 42990.patch for testing, but it appears to need a refresh.