Repository navigation
Repair wp/6.0 branch Actions: Fix ReflectionException on PHP 5.6/7.0 in block-pattern REST tests - #84285
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. |
c17e05a to
2bd88d2
Compare
2bd88d2 to
85cd55a
Compare
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
85cd55a to
d6fba29
Compare
|
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
d6fba29 to
1be8479
Compare
1be8479 to
abc3fa4
Compare
Part of #82933.
What?
Replaces
ReflectionClass::getStaticPropertyValue()/setStaticPropertyValue()calls withReflectionProperty::getValue()/setValue()inphpunit/class-wp-rest-block-patterns-controller-test.phpandphpunit/class-wp-rest-block-pattern-categories-controller-test.php.Why?
On PHP 7.1 and older,
ReflectionClass::getStaticPropertyValue()/setStaticPropertyValue()ignore a priorsetAccessible( true )on a separately obtainedReflectionPropertyand throw a misleadingReflectionException("does not have a property named instance") for a private static property that exists. Both test classes swap the registry singleton this way inwpSetUpBeforeClass()/wpTearDownAfterClass(), so they error on the5.6/7.0legs. Staying on theReflectionPropertyobject works on every PHP version; the teardown also gains thesetAccessible( true )call thatReflectionProperty::setValue()needs.How?
The same root cause and fix as
wp/6.1's #84257, applied to this branch's copies of the two files (namedclass-wp-rest-…here).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.
🤖 Generated with Claude Code