Skip to content

Add PHPUnit 7.x and 8.x to version constraint for PHP 7.1/7.2 support#589

Merged
JayBizzle merged 2 commits intomasterfrom
copilot/update-phpunit-version-constraint
Feb 2, 2026
Merged

Add PHPUnit 7.x and 8.x to version constraint for PHP 7.1/7.2 support#589
JayBizzle merged 2 commits intomasterfrom
copilot/update-phpunit-version-constraint

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

CI fails on PHP 7.1 and 7.2 because the PHPUnit constraint jumps from ^6.5 (max PHP 7.2) to ^9.4 (min PHP 7.3), skipping versions 7.x and 8.x that bridge the gap.

Changes

  • Updated composer.json PHPUnit constraint from ^4.8|^5.5|^6.5|^9.4 to ^4.8|^5.5|^6.5|^7.5|^8.5|^9.4

Composer will now auto-select:

  • PHPUnit 7.x for PHP 7.1-7.3
  • PHPUnit 8.x for PHP 7.2-7.4
  • PHPUnit 9.x for PHP 7.3+
Original prompt

Problem

The GitHub Actions test workflow is failing for PHP 7.2 (and will also fail for PHP 7.1) because of an incompatible PHPUnit version constraint in composer.json.

Error:

Problem 1
- Root composer.json requires phpunit/phpunit ^4.8|^5.5|^6.5|^9.4 -> satisfiable by phpunit/phpunit[9.6.33, 9.6.34].
- phpunit/phpunit[9.6.33, ..., 9.6.34] require php >=7.3 -> your php version (7.2.34) does not satisfy that requirement.

Root Cause:
The current PHPUnit constraint ^4.8|^5.5|^6.5|^9.4 skips PHPUnit versions 7.x and 8.x, which are the versions compatible with PHP 7.1 and 7.2. When Composer tries to resolve dependencies for PHP 7.2, it jumps to PHPUnit 9.x which requires PHP >=7.3.

Solution

Update the require-dev section in composer.json to include PHPUnit 7.x and 8.x:

"require-dev": {
    "phpunit/phpunit": "^4.8|^5.5|^6.5|^7.5|^8.5|^9.4"
}

PHPUnit version compatibility:

  • PHPUnit 7.x supports PHP 7.1-7.3
  • PHPUnit 8.x supports PHP 7.2-7.4
  • PHPUnit 9.x supports PHP 7.3+

This will allow Composer to automatically select the appropriate PHPUnit version based on the PHP version being tested, enabling the test matrix to run successfully across all PHP versions from 7.1 to 8.4.

Reference:

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…mpatibility

Co-authored-by: JayBizzle <340752+JayBizzle@users.noreply.github.com>
Copilot AI changed the title [WIP] Update PHPUnit version constraint for PHP 7.1 and 7.2 Add PHPUnit 7.x and 8.x to version constraint for PHP 7.1/7.2 support Feb 2, 2026
Copilot AI requested a review from JayBizzle February 2, 2026 19:04
@JayBizzle JayBizzle marked this pull request as ready for review February 2, 2026 19:06
@JayBizzle JayBizzle merged commit 880c12d into master Feb 2, 2026
10 checks passed
@JayBizzle JayBizzle deleted the copilot/update-phpunit-version-constraint branch February 2, 2026 19:07
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