Repository navigation
Tests: Clean up custom post types in Tests_Link_GetDeletePostLink - #15495
devmuhib009 wants to merge 1 commit into
Conversation
|
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, @devmuhib009. Holding this one for now, along with the rest of this series; see https://core.trac.wordpress.org/ticket/65893#comment:656 for why. AI review · |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change centralizing custom post type cleanup in test teardown.
No open issues 🎉
What changed in this PR
Centralizes custom post type cleanup in Tests_Link_GetDeletePostLink::tear_down() to improve test isolation.
Changes:
- Unregisters
cpt_unreg_testandcpt_delete_testduring teardown. - Removes the redundant
cpt_delete_testunregistration from the individual test.
| File | Description |
|---|---|
tests/phpunit/tests/link/getDeletePostLink.php |
Moves custom post type cleanup into the shared teardown method. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
Please drop both added teardown calls and retain only removal of the cpt_delete_test cleanup. Its result is already captured before that call. Preserve the in-test cpt_unreg_test unregister: it creates the missing-post-type scenario. Inherited setup resets ordinary registrations; the proposed extra class-boundary cleanup has no demonstrated affected consumer.
AI review · gpt-6
See #65893. Props devmuhib009.
63cf315 to
046cd65
Compare
lancewillett
left a comment
There was a problem hiding this comment.
The delete-link test captures its result before the deleted cleanup. The separate test that needs an unregistered post type still unregisters it. The affected classes passed locally in randomized order on single site and multisite. Thanks for narrowing this.
AI review · gpt-6
Remove duplicate cleanup for ordinary post types. Use `unregister_post_type()` where the test needs a type to disappear before an assertion. Developed in: #15489, #15491, #15492, #15493, #15495, #15496 Props devmuhib, peterwilsoncc. See #66755. git-svn-id: https://develop.svn.wordpress.org/trunk@65757 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15495 landed in https://core.trac.wordpress.org/changeset/65757 |
Trac ticket: https://core.trac.wordpress.org/ticket/66755
Remove the redundant unregister call for
cpt_delete_test. Preserve the separate case that exercises an unregistered post type. Core resets these registrations before the next test.