Repository navigation
Tests: Keep the test taxonomy available during term-parent fixture deletion - #15193
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 are recorded for the test-fixture cleanup change.
No open issues 🎉
What changed in this PR
Fixes the test-fixture cleanup regression introduced by #15038 by keeping wptests_tax registered until class-level term deletion completes.
Changes:
- Removes per-test teardown and class-level taxonomy unregister calls.
- Preserves existing term deletion, relying on the next per-test setup to reset taxonomies.
- Leaves assertions and production behavior unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/term/getTermParentsList.php |
Removes premature taxonomy cleanup so class teardown can delete fixture terms. |
Review effort: Balanced
|
Narrowed in a4db49e: keep the final class unregister after both term deletions. Only the premature per-test teardown is removed. This retains the demonstrated deletion fix and preserves the class boundary. Randomized single-site and multisite checks passed (13 tests / 13 assertions each). Peter’s independent review remains pending. AI review · |
The per-test
unregister_taxonomy()removeswptests_taxbefore the existing class teardown callswp_delete_term(). A diagnostic of those existing calls returnedfalsefor both deletions before the change andtrueafter removing only the per-test unregister, in single-site and multisite.Remove the premature per-test teardown. Keep the final class-level unregister after both term deletions, preserving the existing class boundary. No assertions or production behavior change.
Follow-up to #15038. See https://core.trac.wordpress.org/ticket/65893.
Validation: PHP syntax and PHPCS passed. Randomized checks (seed
15193) passed 13 tests / 13 assertions in both modes, before and after. The diagnostic establishes the cleanup benefit; the green tests alone do not.Prepared with AI assistance (gpt-6).