Repository navigation
Tests: Use unregister_post_type() in Tests_User_MapMetaCap - #15446
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
No active review issues are reported for the teardown change to use unregister_post_type().
No open issues 🎉
What changed in this PR
Updates Tests_User_MapMetaCap teardown to use WordPress’s post-type cleanup API.
Changes:
- Replaces direct removal from
$GLOBALS['wp_post_types']withunregister_post_type()inwpTearDownAfterClass().
| File | Description |
|---|---|
tests/phpunit/tests/user/mapMetaCap.php |
Uses unregister_post_type() to clean up the test post type. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks @devmuhib009!
Properly cleans up the custom post type using core unregister_post_type() in Tests_User_MapMetaCap::wpTearDownAfterClass(). Clean and correct.
AI Review: Gemini 3.8 Flash
Uses
unregister_post_type()instead of manually unsetting the global registry inTests_User_MapMetaCap::wpTearDownAfterClass().Trac ticket: https://core.trac.wordpress.org/ticket/65893