Repository navigation
Tests: Clean up custom post type in Tests_Post_wpListPages - #15453
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:
|
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks @devmuhib009!
Properly unregisters the taco custom post type in tear_down() and removes the mid-test unregistration call in Tests_Post_wpListPages, preventing fixture leakage across tests. Looks good to me!
AI Review: Gemini 3.8 Flash
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change moving custom post type cleanup into test teardown.
No open issues 🎉
What changed in this PR
This PR improves fixture cleanup in Tests_Post_wpListPages by moving custom post type removal into the test teardown lifecycle.
Changes:
- Adds
tear_down()to unregistertacousing the publicunregister_post_type()API before calling the parent teardown. - Removes the internal mid-test cleanup call so cleanup still runs if an assertion fails.
| File | Description |
|---|---|
tests/phpunit/tests/post/wpListPages.php |
Moves custom post type cleanup into teardown and uses the public API. |
Review effort: Balanced
Trac ticket: https://core.trac.wordpress.org/ticket/65893
This PR unregisters the
tacocustom post type registered duringTests_Post_wpListPages::test_wp_list_pages_classes_with_hierarchical_cpt()intear_down()using the publicunregister_post_type()function, preventing fixture leakage and replacing the internal mid-test call.