Skip to content

r56991 Test 2: Fixes static property handling. #5561

Closed
hellofromtonya wants to merge 3 commits intoWordPress:trunkfrom
hellofromtonya:r56991/fix-test-using-reflectionproperty
Closed

r56991 Test 2: Fixes static property handling. #5561
hellofromtonya wants to merge 3 commits intoWordPress:trunkfrom
hellofromtonya:r56991/fix-test-using-reflectionproperty

Conversation

@hellofromtonya
Copy link
Copy Markdown
Contributor

@hellofromtonya hellofromtonya commented Oct 24, 2023

@costdev found the test in r56991 did not properly handle the private static property:

  • It set the object using WP_Block 🤦‍♀️
  • It needs to also reset to the original value when done.

This PR fixes both of these issues.

It also addresses handling issues.

It also adds an inline comment to explain why an instance of WP_Duotone is needed. IMO having an instance is confusing.
Why? WP_Duotone is a static class by design (as noted above), meaning it's not intended to be an object. But as of PHP 8.3, not passing an instance to ReflectionProperty::setValue() is deprecated. Therefore, an instance is needed to run in all Core supported PHP versions.

Trac ticket: https://core.trac.wordpress.org/ticket/59694


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@costdev costdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hellofromtonya! Looks good to me!

@hellofromtonya hellofromtonya force-pushed the r56991/fix-test-using-reflectionproperty branch from 4b78254 to 3d18830 Compare October 24, 2023 10:32
@hellofromtonya
Copy link
Copy Markdown
Contributor Author

Committed into trunk via https://core.trac.wordpress.org/changeset/56996 and to 6.4 branch via https://core.trac.wordpress.org/changeset/56997.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants