[wp-trac] [WordPress Trac] #42990: Deprecate WP_UnitTestCase::_make_attachment

WordPress Trac noreply at wordpress.org
Thu Dec 28 13:07:38 UTC 2017


#42990: Deprecate WP_UnitTestCase::_make_attachment
------------------------------+-----------------------------
 Reporter:  Frank Klein       |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42990>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list