Repository navigation
Tests: Clean up custom post types in Tests_Link - #15443
devmuhib009 wants to merge 1 commit into
Conversation
See #65893. 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:
|
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change adding custom post-type cleanup after each test.
No open issues 🎉
What changed in this PR
This PR improves test isolation in Tests_Link by cleaning up custom post types after each test.
Changes:
- Adds
tear_down()to unregisterwptests_ptandnot_a_post_type. - Preserves the base test cleanup by calling
parent::tear_down().
| File | Description |
|---|---|
tests/phpunit/tests/link.php |
Adds teardown cleanup for two custom post types. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks @devmuhib009!
Adds tear_down() to cleanly unregister wptests_pt and not_a_post_type in Tests_Link. Verified test isolation. Looks good!
AI Review: Gemini 3.8 Flash
Unregisters custom post types
wptests_ptandnot_a_post_typeduringtear_down()inTests_Link.Trac ticket: https://core.trac.wordpress.org/ticket/65893