Repository navigation
Tests: Cover wp_is_heic_image_mime_type() - #15800
devmuhib009 wants to merge 2 commits into
Conversation
See #65819. Props devmuhib009.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks for working on this, @devmuhib009! Clean coverage for wp_is_heic_image_mime_type() across HEIC/HEIF and standard image MIME types.
Per #65819 comment 1521, test-only changes now get their own Trac ticket in the component of the code under test instead of #65819.
For image MIME-type validation, the most fitting component is Media (or General).
Could you please:
- Open a new Trac ticket in Media (or General) with the
has-patchandhas-unit-testskeywords and link this PR. - Update the
Trac ticket:reference in this PR's description. - Update the
@ticket 65819annotations inwpIsHeicImageMimeType.phpwith the new ticket ID.
AI Review: Gemini 3.8 Flash
See #66624. Props devmuhib009.
|
@devmuhib009 this note covers your new-test PRs and Trac tickets, including the 13 opened Nov 7 (#15788–#15800, Trac #66610–#66624). New tests in Core need to earn their place. The bar, from #52895 comment 207: "Ideally new tests are in relation to a broken feature, bug/regression, versus just adding coverage for its own sake." A function with no tests isn't enough reason on its own. Every test adds run time and upkeep for everyone who works on that code. Before anyone reviews these:
New tests go to the maintainers of each ticket's component for review and landing. I won't be reviewing these for Build/Test Tools. This doesn't change the hold on the #65893 series, which stands per #65893 comment 656. AI review · |
|
Thank you for taking the time to provide this feedback and for clarifying the expectations around new tests in WordPress Core. I understand the concern about adding tests solely for coverage without a clear connection to a bug or regression. I’ll hold off on opening additional PRs and review each existing PR and Trac ticket accordingly. I’ll identify the specific bug or regression each test would have caught, add the relevant ticket or changeset references, and close the PRs and tickets that don't meet this requirement. I’ll also review the ticket types, update them to enhancements where appropriate, and resolve the duplicate tickets for I appreciate the guidance and will make sure my future contributions align with the Core team's testing standards and component maintainers' review process. |
Description
Adds unit tests for the
wp_is_heic_image_mime_type()function insrc/wp-includes/functions.php.The tests cover:
image/heic,image/heif,image/heic-sequence,image/heif-sequence) return true.image/jpeg,image/png,image/webp,image/avif,application/pdf, empty string) return false.public staticfor PHPUnit 10+ compatibility.Test-only change.
Testing Instructions
Trac ticket: https://core.trac.wordpress.org/ticket/66624