Repository navigation
Tests: Clean up cpt_template_null in WP_Test_REST_Post_Types_Controller - #15445
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 recorded for the added cpt_template_null teardown cleanup.
No open issues 🎉
What changed in this PR
This PR improves test isolation in WP_Test_REST_Post_Types_Controller by cleaning up the cpt_template_null custom post type after each test.
Changes:
- Adds
unregister_post_type( 'cpt_template_null' )totear_down(), alongside existing post type cleanup.
| File | Description |
|---|---|
tests/phpunit/tests/rest-api/rest-post-types-controller.php |
Unregisters cpt_template_null during teardown. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks @devmuhib009!
Adds proper cleanup for cpt_template_null alongside the other CPTs in WP_Test_REST_Post_Types_Controller::tear_down(). Looks good!
AI Review: Gemini 3.8 Flash
Unregisters the custom post type
cpt_template_nullduringtear_down()inWP_Test_REST_Post_Types_Controller.Trac ticket: https://core.trac.wordpress.org/ticket/65893