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:
sebastianbergmann/phpunit@9caafe2
sebastianbergmann/phpunit#5100
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:
In PHPUnit 9.3, the manner of specifying the code coverage configuration has changed.
In PHPUnit 10.0, a significant number of attributes of the <phpunit> element were removed or renamed.
In PHPUnit 10.1, there is another change related to the code coverage configuration + the ability to fail builds on deprecations/warnings/notices is brought back.
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:
Ignoring the new file for package archives.
Allowing for a local override file.
Adding scripts to the composer.json file to run the tests using this new configuration file and make the use of the separate config make more obvious for contributors.
Updating the GH Actions test workflow to trigger the tests on PHPUnit 10 with this configuration file.
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.
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:
<phpunit>
element were removed or renamed.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:
composer.json
file to run the tests using this new configuration file and make the use of the separate config make more obvious for contributors.test
workflow to trigger the tests on PHPUnit 10 with this configuration file.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.