Make WordPress Core

Opened 20 months ago

Last modified 7 months ago

#42990 new enhancement

Deprecate WP_UnitTestCase::_make_attachment

Reported by: Frank Klein Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:


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)

42990.patch (24.8 KB) - added by Frank Klein 20 months ago.

Download all attachments as: .zip

Change History (3)

@Frank Klein
20 months ago

#1 @Frank Klein
20 months ago

  • Keywords has-patch added

#2 @pento
7 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.