Repository navigation
Repair wp/6.1 branch Actions: Stop failing PHPUnit on PHP 8.2 deprecation notices - #84256
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. |
5d92cf5 to
2871ce4
Compare
|
Size Change: 0 B Total Size: 1.26 MB ℹ️ View Unchanged
|
2871ce4 to
1239fa5
Compare
|
Size Change: 0 B Total Size: 1.26 MB ℹ️ View Unchanged
|
1239fa5 to
0c2335c
Compare
ramonjd
left a comment
There was a problem hiding this comment.
| Includes this change? | PHP 8.2 single site | PHP 8.2 multisite | |
|---|---|---|---|
| Base #84255 | No | 554 tests, 58 errors: 26 Creation of dynamic property, 21 strncmp(): Passing null, 11 Use of "static" in callables |
Passes (494 tests) |
| This PR #84256 | Yes | No result: cancelled by fail-fast after the PHP 7.4 job failed in npm ci (npm ERR! cb() never called!), before any test ran |
No result: cancelled, same reason |
| Top of stack #85137 | Yes (phpunit.xml.dist and phpunit/multisite.xml are identical to #84256's) |
554 tests, 0 errors | Passes (494 tests) |
Part of #82932.
What?
Sets
convertDeprecationsToExceptions="false"inphpunit.xml.dist.Why?
On the PHP 8.2 leg added in #84248, PHPUnit fails with 58 errors. All of them are deprecation notices from this branch's existing code, not failing tests:
Creation of dynamic property ... is deprecated(PHP 8.2): test classes set undeclared properties such as$this->theme_root.strncmp(): Passing null to parameter #1(PHP 8.1):get_property_value()inlib/compat/wordpress-6.1/class-wp-theme-json-6-1.php.Use of "static" in callables is deprecated(PHP 8.2): the Style Engine's'static::get_individual_property_css_declarations'value functions.convertDeprecationsToExceptions="true"turned each notice into an error. Withfalse, deprecations are still reported but don't fail the run, which is PHPUnit 10's default.Why weren't these fixed on this branch?
This branch only ever ran PHPUnit on a single PHP version, and WordPress 6.1 shipped (2022-11-01) before PHP 8.2 was released (2022-12-08). Trunk fixed these afterwards, alongside adding its PHP version matrix, and none of the fixes were backported:
strncmp()code was removed from trunk in a later refactor (Fix/wp get global styles for custom props returns internal variable #50366, ccd529d).Relaxing the setting avoids backporting three unrelated fixes into code this branch doesn't ship.
The PHP 5.6 and 7.0 failures in the same job are a separate problem, fixed in #84257.
Use of AI Tools
This PR was authored with the help of Claude Code.