Skip to content

Commit

Permalink
Drop support for PHPUnit < 7.5 [1]
Browse files Browse the repository at this point in the history
Adjust CI, README and `composer.json` for the drop of support for PHPUnit < 7.5.0.

The 7.5.0 version is a deliberate choice to allow for dropping all PHPUnit 7.x related polyfills.
  • Loading branch information
jrfnl committed Jan 14, 2025
1 parent b4c70e2 commit 5be3794
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,23 @@ jobs:
include:
# Test against a version on the low-end of the PHPUnit versions supported for each PHP version.
# Using the Composer `--prefer-lowest` option is, unfortunately, not viable, as
# it would result PHP 7.1 - 7.4 all using PHPUnit 6.4.4, which is not the intention.
# it would result PHP 7.1 - 7.4 all using PHPUnit 7.5.0, which is not the intention.
# It also would run into trouble with PHP 8.5.12 being used on PHP 8.0+, while the
# 8.5.12 release still contained a bug which makes it incompatible with PHP 8.1+,
# even though it officially allows for it.
#
# Note: PHPUnit 10 is not supported for the PHPUnit Polyfills 3.x branch, so there are
# Note: PHPUnit 10 is not supported for the PHPUnit Polyfills 4.x branch, so there are
# no builds against PHPUnit 10!
- php: '7.1'
phpunit: '~6.4.4'
phpunit: '7.5.0'
coverage: true
experimental: false
- php: '7.2'
# - PHPUnit 7.0 seems to have an issue with something related to TestListeners, so using PHPUnit 7.1 instead for "low".
phpunit: '~7.1.0'
phpunit: '~7.5.0'
coverage: true
experimental: false
- php: '7.3'
phpunit: '7.2.7'
phpunit: '7.5.16'
coverage: true
experimental: false
- php: '7.4'
Expand Down Expand Up @@ -203,27 +202,14 @@ jobs:
# and very select other combinations.
# This should be sufficient to record the coverage for the PHAR specific code.

# PHPUnit 6 is only supported for PHPUnit 6.4.4-latest on the officially supported PHP versions.
# PHPUnit 7 is only supported for PHPUnit 7.5.0-latest on the officially supported PHP versions.
- php: '7.1'
phpunit: '6.4'
- php: '7.1'
phpunit: '6'
- php: '7.2'
phpunit: '6.4'
- php: '7.2'
phpunit: '6'
phpunit: '7.5'
coverage: true

# PHPUnit 7 is fully supported for the officially supported PHP versions.
# Caveats:
# - PHPUnit 7.0 seems to have an issue with something related to TestListeners, so using PHPUnit 7.1 instead for "low".
# - PHPUnit 7 supports PHP 7.3 as of PHPUnit 7.3.0 (for our purposes).
- php: '7.1'
phpunit: '7.1'
- php: '7.1'
phpunit: '7'
- php: '7.3'
phpunit: '7.3'
phpunit: '7.5'
- php: '7.3'
phpunit: '7'
coverage: true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Requirements
------------

* PHP 7.1 or higher.
* [PHPUnit] 6.4 - 9.x and 11.x (automatically required via Composer).
* [PHPUnit] 7.5 - 9.x and 11.x (automatically required via Composer).

[PHPUnit]: https://packagist.org/packages/phpunit/phpunit

Expand Down Expand Up @@ -65,7 +65,7 @@ Why use the PHPUnit Polyfills?

This library is set up to allow for creating PHPUnit cross-version compatible tests by offering a number of polyfills for functionality which was introduced, split up or renamed in PHPUnit.

### Write your tests for PHPUnit 11.x and run them on PHPUnit 6.4 - 11.x
### Write your tests for PHPUnit 11.x and run them on PHPUnit 7.5 - 11.x

The polyfills have been setup to allow tests to be _forward_-compatible. What that means is, that your tests can use the assertions supported by the _latest_ PHPUnit version, even when running on older PHPUnit versions.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"require": {
"php": ">=7.1",
"phpunit/phpunit": "^6.4.4 || ^7.0 || ^8.0 || ^9.0 || ^11.0"
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0 || ^11.0"
},
"require-dev": {
"php-parallel-lint/php-console-highlighter": "^1.0.0",
Expand Down

0 comments on commit 5be3794

Please sign in to comment.