#34075 closed task (blessed) (fixed)
Consolidate methods for creating image attachments in tests
| Reported by: | joemcgill | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
In our test suite, we have three instances of a _make_attachment() helper function for uploading a file and creating an attachment for tests. They are in tests/image/intermediate_size.php, tests/post/attachment.php, and tests/ajax/MediaElement.php.
We should replace these helper functions with a new factory method inside WP_UnitTest_Factory_For_Attachment.
Change History (6)
This ticket was mentioned in Slack in #core by joemcgill. View the logs.
11 years ago
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Or we could just have a globally-available tool - either a method on
WP_UnitTestCase, or a utils function.