Skip to content

Clear the PHP 8.5 test warnings#104

Merged
malberts merged 1 commit into
masterfrom
tests/php85-warnings
Jun 12, 2026
Merged

Clear the PHP 8.5 test warnings#104
malberts merged 1 commit into
masterfrom
tests/php85-warnings

Conversation

@malberts

Copy link
Copy Markdown
Collaborator

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).
  • Three test files' names don't match the class they declare, which PHPUnit flags as "test case class not matching filename".

What

  • Drop the setAccessible() call in BootstrapComponentsServiceTest; the reflective invokeArgs() on the private method works without it on PHP 8.1+.
  • Rename the three files to match their (already-correct) class names:
    • BootstrapComponentServiceTest.php -> BootstrapComponentsServiceTest.php
    • BootstrapComponentsJsonTestCaseScriptRunnerTest.php -> BootstrapComponentsJSONScriptTestCaseRunnerTest.php
    • readmeContentsBuilder.php -> ReadmeContentsBuilder.php

No 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.

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>
@malberts malberts force-pushed the tests/php85-warnings branch from 31fd11f to 6796049 Compare June 12, 2026 11:28
@malberts malberts marked this pull request as ready for review June 12, 2026 11:37
@malberts malberts merged commit 6c60614 into master Jun 12, 2026
5 of 6 checks passed
@malberts malberts deleted the tests/php85-warnings branch June 12, 2026 11:48
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.

1 participant