Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ce504ee to
96e2503
Compare
96e2503 to
e77f596
Compare
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
e77f596 to
505b58a
Compare
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
wp/6.0 branch Actions: use PHPUnit Polyfills' set_up()/tear_down() fixture methodswp/6.0 branch Actions: Use PHPUnit Polyfills' fixture method names
505b58a to
87097d8
Compare
87097d8 to
9f7b981
Compare
andrewserong
left a comment
There was a problem hiding this comment.
LGTM! Looks like a straightforward rename 👍
Part of #82933.
What?
Fixes a fatal error, identical across all six
PHP 7.4/8.0/8.1(single-site and multisite)unit-test.ymllegs, that blocks PHPUnit from even starting the test suite.Why?
#84279 (the base of this PR) bumped
wp-phpunit/wp-phpunitto6.0.x, which makesWP_UnitTestCaseextendyoast/phpunit-polyfills'TestCase. That class declaressetUp(),tearDown(),setUpBeforeClass()andtearDownAfterClass()with a: voidreturn type. Subclasses are expected to override the snake_caseset_up(),tear_down(),set_up_before_class()andtear_down_after_class()methods instead, which work on PHP versions withoutvoidreturn types.Nine test classes in this repository still override the camelCase methods without a return type. On PHP 7.1 and later, that is an incompatible declaration:
This affects the
PHP 7.4,8.0and8.1jobs in the current matrix.How?
Renames each affected method to its Polyfills name, including the corresponding
parent::call where one exists. Differences between files:phpunit/class-wp-webfonts-local-provider-test.phpalready had a correctly-namedtear_down(); only itssetUp()needed renaming.phpunit/navigation-test.php'ssetUp()/tearDown()never callparent::setUp()/parent::tearDown(), so only the method names themselves needed changing.phpunit/navigation-page-test.phpis the only file with staticsetUpBeforeClass()/tearDownAfterClass()overrides in addition to the instance methods — all four needed renaming.phpunit/class-wp-test-rest-users-controller.phpalso defineswpSetUpBeforeClass()/wpTearDownAfterClass()— a separate, WP-specific factory convention (not PHPUnit's own fixture methods) — left untouched.Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.