Repository navigation
Tests: Remove redundant registration cleanup from presentation tests - #15191
lancewillett wants to merge 2 commits 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:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the removal of redundant test registration cleanup.
No open issues 🎉
What changed in this PR
This PR simplifies WordPress presentation tests by removing registration cleanup added for #65893 that duplicates the shared per-test reset.
Changes:
- Removes teardown overrides and calls that unregister ordinary post types, taxonomies, and custom post statuses.
- Preserves assertions, scenario-specific unregister calls, and unrelated fixture cleanup.
- Leaves the base test lifecycle and production code unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/widgets/wpWidgetTagCloud.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/sitemaps/wpSitemapsUsers.php |
Removes post-type cleanup override. |
tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/sitemaps/wpSitemapsPosts.php |
Removes post-type cleanup override. |
tests/phpunit/tests/rewrite/randomRewriteRules.php |
Removes registration cleanup; retains option cleanup. |
tests/phpunit/tests/oembed/template.php |
Removes post-type cleanup; retains other teardown work. |
tests/phpunit/tests/oembed/getOembedResponseData.php |
Removes custom post-status cleanup override. |
tests/phpunit/tests/oembed/discovery.php |
Removes post-type cleanup override. |
tests/phpunit/tests/meta/registerMeta.php |
Removes post-type cleanup; retains class fixture cleanup. |
tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php |
Removes taxonomy and post-type cleanup override. |
tests/phpunit/tests/media/getAttachmentTaxonomies.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/link/wpForcePlainPostPermalink.php |
Removes custom post-status cleanup override. |
tests/phpunit/tests/link/getPreviewPostLink.php |
Removes post-type cleanup override. |
tests/phpunit/tests/link/getPostTypeArchiveFeedLink.php |
Removes post-type cleanup override. |
tests/phpunit/tests/link/getEditTermLink.php |
Removes per-test and class-level taxonomy cleanup. |
tests/phpunit/tests/link/getEditTagLink.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/link/getAdjacentPost.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/link/editTermLink.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/includes/factory.php |
Removes taxonomy cleanup override. |
tests/phpunit/tests/general/wpGetDocumentTitle.php |
Removes post-type cleanup override. |
tests/phpunit/tests/general/feedLinksExtra.php |
Removes per-test and class-level registration cleanup. |
tests/phpunit/tests/functions/wpGetArchives.php |
Removes post-type cleanup override. |
tests/phpunit/tests/customize/nav-menus.php |
Removes taxonomy cleanup; retains scope cleanup. |
tests/phpunit/tests/customize/nav-menu-item-setting.php |
Removes post-type cleanup; retains scope cleanup. |
tests/phpunit/tests/canonical.php |
Removes per-test and class-level post-type cleanup. |
Review effort: Balanced
|
Narrowed in 85fe4dc: retain the existing class callbacks in canonical, feed-link, and edit-term-link tests. The next per-test reset does not justify removing class-boundary cleanup. Randomized baseline/patched comparisons passed with identical counts (663 tests single-site; 669 multisite). Peter’s independent review remains pending. AI review · |
There was a problem hiding this comment.
🔵 Needs a closer look
Registry resets occur after shared class setup, so removed teardowns may expose subsequent fixtures to leftover registrations, while reported subset runs exclude AJAX and do not establish full-suite class-boundary isolation.
No open issues 🎉
Review effort: Balanced
Core's inherited test setup resets ordinary post types, taxonomies, and non-built-in statuses before each test. Remove duplicate per-test cleanup while retaining scenario-specific unregister calls and unrelated fixture cleanup.
Keep the existing class callbacks in
canonical.php,general/feedLinksExtra.php, andlink/getEditTermLink.php. Class setup precedes per-test reset, so the per-test reset alone does not justify deleting those callbacks. Assertions and fixture creation remain unchanged.See https://core.trac.wordpress.org/ticket/65893.
Validation on current trunk with this patch applied independently: PHP syntax and PHPCS passed. Randomized seed
15191produced identical baseline/patched results: single-site 663 tests / 1,721 assertions; multisite 669 tests / 1,731 assertions. Default groups exclude AJAX. These runs bound compatibility; independent review of class-boundary behavior remains pending.No new tests or assertions. Prepared with AI assistance (gpt-6).