Skip to content

Keep phpstan/phpstan-phpunit in sync with the forced phpunit/phpunit upgrade on lowest-deps CI - #8

Merged
sylfabre merged 1 commit into
mainfrom
sylvain_sync-phpstan-phpunit-lowest-deps
Aug 24, 2026
Merged

Keep phpstan/phpstan-phpunit in sync with the forced phpunit/phpunit upgrade on lowest-deps CI#8
sylfabre merged 1 commit into
mainfrom
sylvain_sync-phpstan-phpunit-lowest-deps

Conversation

@sylfabre

Copy link
Copy Markdown
Contributor

Summary

  • The lowest-deps CI job force-upgrades phpunit/phpunit (and a few other tools) to their latest version after composer-install resolves lowest bounds, but left phpstan/phpstan-phpunit behind at whatever old version it resolved to.
  • Once a project's test suite uses PHPUnit's ->expects()->method() mock chain, the stale phpstan-phpunit extension references a PHPUnit mock class that no longer exists in the force-upgraded PHPUnit, and vendor/bin/phpstan fails with a class.notFound error on the lowest matrix legs.
  • Confirmed and fixed the same issue in assoconnect/validator-bundle#85; porting the fix here since this template ships the same workflow and the same assoconnect/php-quality-config dependency that pulls in phpstan/phpstan-phpunit.

Test plan

  • Reproduced locally in Docker (php:8.4-cli + bcmath/intl): composer update --prefer-lowest --prefer-stable then the tool-upgrade step reproduces phpstan/phpstan-phpunit staying at 2.0.0 while phpunit/phpunit jumps to 13.x, triggering the class.notFound error on a test using ->expects()->method().
  • With phpstan/phpstan-phpunit added to the upgrade step, phpstan/phpstan-phpunit upgrades to 2.0.18 alongside phpunit/phpunit and the error disappears.

🤖 Generated with Claude Code

…upgrade on lowest-deps CI

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sylfabre
sylfabre merged commit af6692a into main Aug 24, 2026
0 of 4 checks passed
@sylfabre
sylfabre deleted the sylvain_sync-phpstan-phpunit-lowest-deps branch August 24, 2026 08:47
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