php-parallel-lint / PHP-Parallel-Lint

This tool check syntax of PHP files faster than serial check with fancier output.
Other
287 stars 21 forks source link

2.0 | Make tests compatible with PHPUnit 10 #157

Closed jrfnl closed 6 months ago

jrfnl commented 7 months ago

Tests: make dataproviders static

As of PHPUnit 10, data providers are (again) expected to be static methods.

This updates the test suite to respect that.

Includes removing the use of $this from select data providers.

Refs:

PHPUnit: allow for PHPUnit 10 + add separate configuration

The PHPunit configuration file specification has undergone changes in PHPUnit 9.3, 10.0 and 10.1.

Most notably:

While the --migrate-configuration command can upgrade a configuration for the changes in the format made in PHPUnit 9.3, some of the changes in the configuration format in PHPUnit 10 don't have one-on-one replacements and/or are not taken into account.

As this package is used in the CI pipeline for other packages, it is important for this package to be ready for new PHP releases early, so failing the test suite on deprecatios/notices and warnings is appropriate.

With that in mind, I deem it more appropriate to have a dedicated PHPUnit configuration file for PHPUnit 10 to ensure the test run will behave as intended.

This commit adds this dedicated configuration file for PHPUnit 10.1+.

Includes:

Ref:


Note: while PHPUnit 11 has come out in the mean time as well, making the test suite compatible with that should wait for a while as we'll need PHPUnit 11.1 (expected April 5th) as a minimum and will need to make significant other changes to the tests, like splitting test classes based on what the tests cover, before we can start running the tests on PHPUnit 11.