Repository navigation
Repair wp/6.1 branch Actions: Fix ReflectionException on PHP 5.6/7.0 in block-pattern REST tests - #84257
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. |
95dd711 to
01317d7
Compare
|
Size Change: 0 B Total Size: 1.26 MB ℹ️ View Unchanged
|
01317d7 to
5de9721
Compare
|
Size Change: 0 B Total Size: 1.26 MB ℹ️ View Unchanged
|
…ass::getStaticPropertyValue()/setStaticPropertyValue().
5de9721 to
b8f2e7f
Compare
Part of #82932.
What?
In the block pattern and block pattern category REST controller tests, uses
ReflectionProperty::getValue()andsetValue()instead ofReflectionClass::getStaticPropertyValue()andsetStaticPropertyValue()to swap each registry's private static$instanceduring setup and teardown.Why?
On PHP 5.6 and 7.0,
getStaticPropertyValue()andsetStaticPropertyValue()ignoresetAccessible( true )for private properties and throwReflectionException: Class WP_Block_Patterns_Registry does not have a property named instance(and the same forWP_Block_Pattern_Categories_Registry). That causes 18 errors in each PHP 5.6 and 7.0 job. PHP 7.4 and newer aren't affected.Use of AI Tools
This PR was authored with the help of Claude Code, including live reproduction and verification against real PHP 5.6/7.0 interpreters and a real wp-env-managed WordPress installation (not log analysis alone).