Clear the PHP 8.5 test warnings#104
Merged
Merged
Conversation
PHP 8.5 deprecates ReflectionMethod::setAccessible(); it has been a no-op since 8.1, so the reflective invokeArgs() in BootstrapComponentsServiceTest works without it. Drop the call to clear the deprecation on the master/PHP 8.5 row; it is a no-op on the older rows. Rename three test files whose names did not match the class they declare, which PHPUnit flags as "test case class not matching filename" (the class names are already correct and are left unchanged): - BootstrapComponentServiceTest.php -> BootstrapComponentsServiceTest.php - BootstrapComponentsJsonTestCaseScriptRunnerTest.php -> BootstrapComponentsJSONScriptTestCaseRunnerTest.php - readmeContentsBuilder.php -> ReadmeContentsBuilder.php Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
31fd11f to
6796049
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
master/ PHP 8.5 CI row had a deprecation error and a warning that the other rows don't:ReflectionMethod::setAccessible()is deprecated since PHP 8.5 (it has been a no-op since 8.1, when reflection stopped honouring visibility).What
setAccessible()call inBootstrapComponentsServiceTest; the reflectiveinvokeArgs()on the private method works without it on PHP 8.1+.BootstrapComponentServiceTest.php->BootstrapComponentsServiceTest.phpBootstrapComponentsJsonTestCaseScriptRunnerTest.php->BootstrapComponentsJSONScriptTestCaseRunnerTest.phpreadmeContentsBuilder.php->ReadmeContentsBuilder.phpNo behavioural change and the class names are untouched. This clears the last error and the filename warnings, so the full matrix (including
master/ PHP 8.5) is green and warning-free.