Skip to content

fix(deps): revert phpunit to ^11.5 for PHP 8.3 compatibility - #276

Merged
dermatz merged 1 commit into
mainfrom
fix/phpunit-php83-compat
Nov 6, 2026
Merged

dermatz merged 1 commit into
mainfrom
fix/phpunit-php83-compat

Conversation

@dermatz

@dermatz dermatz commented Nov 6, 2026

Copy link
Copy Markdown
Member

Problem

The PHPUnit workflow has been failing on main since #274 (phpunit/phpunit ^11.5 → ^13.4):

  • PHP 8.3 job: composer install fails, because PHPUnit 13 requires PHP >= 8.4.1 while the module supports ~8.3.0||~8.4.0||~8.5.0.
  • PHP 8.4 job: PHPUnit 13 no longer reads doc-comment metadata, so the @dataProvider tests in TemplateCopierTest fail with ArgumentCountError. There are also many "no expectations configured" mock deprecations.
  • Infection: fails as a follow-up.

Fix

Restore phpunit/phpunit to ^11.5, which works on every supported PHP version (the full suite passes locally on 11.5.56).

Follow-up (not part of this PR)

A move to PHPUnit 12/13 needs the tests migrated to attributes and the mocks cleaned up. 13 additionally requires dropping PHP 8.3 support. Consider ignoring major phpunit/phpunit updates in .github/dependabot.yml until then.

PHPUnit 13 requires PHP >= 8.4.1 and drops doc-comment metadata, which breaks
the PHP 8.3 matrix job and the data-provider tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the PHPUnit dependency rollback to ^11.5.

No open issues 🎉

What changed in this PR

Reverts the PHPUnit upgrade from #274 to restore compatibility with MageForge’s supported PHP versions and existing tests.

Changes:

  • Changes phpunit/phpunit from ^13.4 to ^11.5, retaining PHP 8.3 support and compatibility with doc-comment test metadata.
  • Leaves migration to newer PHPUnit versions for a separate follow-up.
File Description
composer.json Restores the PHPUnit development dependency to ^11.5.

Review effort: Balanced

@dermatz dermatz changed the title 🐛 fix(deps): revert phpunit to ^11.5 for PHP 8.3 compatibility fix(deps): revert phpunit to ^11.5 for PHP 8.3 compatibility Nov 6, 2026
@dermatz
dermatz merged commit 1056514 into main Nov 6, 2026
22 of 23 checks passed
@dermatz
dermatz deleted the fix/phpunit-php83-compat branch November 6, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants