Skip to content

Support PHPUnit 12 alongside 10.5 - #1371

Merged
jaapio merged 3 commits into
mainfrom
task/phpunit-12-upgrade
Sep 1, 2026
Merged

Support PHPUnit 12 alongside 10.5#1371
jaapio merged 3 commits into
mainfrom
task/phpunit-12-upgrade

Conversation

@linawolf

Copy link
Copy Markdown
Contributor

Continues #1327.

Drop CoversMethod attributes incompatible with locked PHPUnit 10.5

CoversMethod is a PHPUnit 11/12-only attribute, but composer.lock still
resolves phpunit/phpunit to the 10.5 line under the new "^10.5 || ^12.0"
constraint, so PHPStan (and PHPUnit itself at runtime) can't find the
attribute class. CoversClass already attributes coverage to the whole
class, so nothing is lost by dropping the redundant per-method attributes.

Assisted-by: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01PP4LkejR5PSubbhNmF4RkT
Signed-off-by: lina.wolf

@linawolf linawolf mentioned this pull request Aug 31, 2026
@linawolf

Copy link
Copy Markdown
Contributor Author

@jaapio this continues your work from #1327 — rebased onto current main, plus a fix for a PHPUnit 10.5 compatibility issue in the CoversMethod attributes that was failing static analysis there. Would you mind taking a look?

@linawolf
linawolf requested a review from jaapio August 31, 2026 13:56

@jaapio jaapio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot! I'm waiting for another pr to be merged. It's very likely this will cause a conflict as the composer.lock is updated in both.

jaapio and others added 2 commits September 1, 2026 15:51
…10.5

CoversMethod is a PHPUnit 11/12-only attribute, but composer.lock still
resolves phpunit/phpunit to the 10.5 line under the new "^10.5 || ^12.0"
constraint, so PHPStan (and PHPUnit itself at runtime) can't find the
attribute class. CoversClass already attributes coverage to the whole
class, so nothing is lost by dropping the redundant per-method attributes.

Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PP4LkejR5PSubbhNmF4RkT
Signed-off-by: lina.wolf
@linawolf
linawolf force-pushed the task/phpunit-12-upgrade branch from ef89383 to 6c30028 Compare September 1, 2026 13:57
PHPUnit 12 no longer executes tests via the @dataProvider docblock
annotation, so ReadOptionReturnTypeExtensionTest's data-provided test
ran with zero arguments and errored under the "highest" dependency CI
matrix (PHP 8.4, PHPUnit 12).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PP4LkejR5PSubbhNmF4RkT
Signed-off-by: lina.wolf
@jaapio
jaapio merged commit 4b2ba8d into main Sep 1, 2026
58 checks passed
@jaapio
jaapio deleted the task/phpunit-12-upgrade branch September 1, 2026 14:58
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