[wp-trac] [WordPress Trac] #56203: Reduce code duplication in AJAX attachment handling tests
WordPress Trac
noreply at wordpress.org
Thu Jul 14 14:34:06 UTC 2022
#56203: Reduce code duplication in AJAX attachment handling tests
--------------------------+-----------------------------
Reporter: martin.krcho | Owner: SergeyBiryukov
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 6.1
Component: Media | Version: trunk
Severity: minor | Resolution:
Keywords: has-patch | Focuses:
--------------------------+-----------------------------
Changes (by SergeyBiryukov):
* owner: (none) => SergeyBiryukov
* status: new => reviewing
Comment:
Hi there, thanks for the ticket and the patch! The first part is now
committed.
The attachments part looks good too, but it appears that the same pattern
is also used in other tests, not only Ajax. So I think this can be a
general helper method in `WP_UnitTestCase_Base`, next to the
`::_make_attachment()` method. That way it can also be reused in other
tests. The name would probably be `_upload_file_and_make_attachment()` for
consistency.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56203#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list