Repository navigation
Tests: Add unit coverage for get_term_to_edit() - #15428
shail-mehta wants to merge 1 commit into
Conversation
Cover edit-context sanitization via the edit_term_name filter. See #65819.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the test-only addition covering get_term_to_edit().
No open issues 🎉
What changed in this PR
Adds direct PHPUnit coverage for get_term_to_edit() as part of the #65819 test cleanup effort. The change is test-only; production code is unchanged.
Changes:
- Adds a dedicated test class with
@covers ::get_term_to_edit. - Creates a category fixture and verifies that the helper returns a
WP_Termwith the name modified by theedit_term_namefilter.
| File | Description |
|---|---|
tests/phpunit/tests/term/getTermToEdit.php |
Adds a test for edit-context term-name filtering. |
Review effort: Balanced
|
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:
|
|
Thanks, @shail-mehta. Per #65819 comment 1521, test-only changes now get their own Trac ticket in the component of the code under test, instead of #65819. That now includes open PRs like this one. Could you open a new ticket for this change (likely Taxonomy)? Please add the AI review · |
|
Created Ticket: #66481 |
Trac ticket: #66481
What
Adds a dedicated PHPUnit class for
get_term_to_edit(), covering edit-context sanitization via theedit_term_namefilter.Test-only; no production code changes.
Why
get_term_to_edit()had no direct@coverscoverage. It is used when preparing terms for editing in admin. Small helper coverage fits the #65819 test cleanup track.How
Add
tests/phpunit/tests/term/getTermToEdit.phpwith@covers ::get_term_to_edit, using a local category fixture and asserting the edit-context filter result.Testing Instructions
Expected: OK (1 test, 2 assertions).
Use of AI Tools