Repository navigation
Tests: Remove redundant post type and taxonomy cleanup in Tests_Block_Templates_GetTemplate_Hierarchy - #16274
Conversation
…_Templates_GetTemplate_Hierarchy
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change simplifying block-template hierarchy test cleanup.
No open issues 🎉
What changed in this PR
Simplifies the block-template hierarchy tests by relying on the shared core test framework to reset post types and taxonomies before each test.
Changes:
- Removes the redundant
tear_down()override that unregisterscustom_book,book_type, andbooks. - Preserves inherited teardown behavior.
| File | Description |
|---|---|
tests/phpunit/tests/block-templates/getTemplateHierarchy.php |
Removes explicit registry cleanup already handled by core test setup. |
Review effort: Balanced
|
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:
|
lancewillett
left a comment
There was a problem hiding this comment.
The class creates these three registrations in per-test setup. Core resets them before the next test, and the parent class fixtures use the built-in template types. Inheriting teardown preserves the template cleanup.
AI review · gpt-6.2-astra
… classes. Core resets these registrations before each test. Remove the trailing unregister calls from the admin bar, query, REST icon collection and block template tests. Keep the icon collection cleanup for its separate registry. Developed in: #16267, #16268, #16269, #16272, #16274 Props shailu25, devmuhib, huzaifaalmesbah, peterwilsoncc, mukesh27. See #66755. git-svn-id: https://develop.svn.wordpress.org/trunk@65815 602fd350-edb4-49c9-b593-d223f7449a82
… classes. Core resets these registrations before each test. Remove the trailing unregister calls from the admin bar, query, REST icon collection and block template tests. Keep the icon collection cleanup for its separate registry. Developed in: WordPress/wordpress-develop#16267, WordPress/wordpress-develop#16268, WordPress/wordpress-develop#16269, WordPress/wordpress-develop#16272, WordPress/wordpress-develop#16274 Props shailu25, devmuhib, huzaifaalmesbah, peterwilsoncc, mukesh27. See #66755. Built from https://develop.svn.wordpress.org/trunk@65815 git-svn-id: http://core.svn.wordpress.org/trunk@64844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #16274 landed in https://core.trac.wordpress.org/changeset/65815 |
Trac ticket: #66755
What
Removes the
tear_down()override inTests_Block_Templates_GetTemplate_Hierarchy(tests/phpunit/tests/block-templates/getTemplateHierarchy.php). It unregisterscustom_book,book_type, andbooks.Why
set_up()inWP_UnitTestCase_Basealready resets custom post types and taxonomies before every core test. These three are registered per test, so the extra cleanup adds nothing.How
Delete the
tear_down()override so the class uses the inherited teardown.Testing Instructions
Use of AI Tools