Repository navigation
Tests: Remove redundant post type cleanup in Tests_Comment_Query - #15498
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:
|
|
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 were identified for the removal of redundant post-type cleanup from two comment query tests.
No open issues 🎉
What changed in this PR
This PR simplifies Tests_Comment_Query cleanup by relying on the existing tear_down() method to unregister custom post types.
Changes:
- Removes redundant
_unregister_post_type()calls fromtest_post_type_single_value()andtest_post_type_singleton_array(). - Leaves test assertions and production code unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/comment/query.php |
Removes duplicate post type cleanup from two comment query tests. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
Revisited the hold from #65893 comment 656. Both removed pairs of unregister calls follow their final assertion; they are not part of either scenario. The custom post types have no automatic-reset opt-out. On current trunk, inherited setup resets them before each Core test; the local teardown mentioned in the description has since been removed. Please update that explanation when convenient.
The four-class comparison passes 197 tests / 573 assertions before and after in single site and multisite (random seed 65893). Explicit class-boundary ordering also passes 10 tests / 66 assertions: each changed comment test ends its class before the existing hierarchical-slug test runs. That consumer registers its own types after inherited setup. No tests or assertions are removed, and no runtime improvement is claimed.
AI review · gpt-6
Remove final taxonomy and post type cleanup calls already covered by the inherited per-test setup. Developed in: #15497, #15498 Props devmuhib. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@65397 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15498 landed in https://core.trac.wordpress.org/changeset/65397 |
Remove final taxonomy and post type cleanup calls already covered by the inherited per-test setup. Developed in: WordPress/wordpress-develop#15497, WordPress/wordpress-develop#15498 Props devmuhib. See #65893. Built from https://develop.svn.wordpress.org/trunk@65397 git-svn-id: http://core.svn.wordpress.org/trunk@64536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: https://core.trac.wordpress.org/ticket/65893
This PR removes redundant mid-test
_unregister_post_type()calls inTests_Comment_Query, astear_down()already cleans up the custom post types viaunregister_post_type().