Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: add separate configuration file for PHPUnit 10 #111

Merged
merged 1 commit into from Apr 1, 2023

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Apr 1, 2023

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

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.

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.

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+.

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.
  • Updating the GH Actions test workflow to trigger the tests on PHPUnit 10 with this configuration file.

Take note that the cacheDirectory option has been set to the same value as PHPUnit natively already used in PHPUnit 8 and 9, even though this is a different value as is used by default in PHPUnit 10.

Ref:

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

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.

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.

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+.

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.
* Updating the GH Actions `test` workflow to trigger the tests on PHPUnit 10 with this configuration file.

Take note that the `cacheDirectory` option has been set to the same value as PHPUnit natively already used in PHPUnit 8 and 9, even though this is a different value as is used by default in PHPUnit 10.

Ref:
* https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-10.0.md#1000---2023-02-03
@jrfnl jrfnl added this to the 2.0.0 milestone Apr 1, 2023
@jrfnl jrfnl merged commit 438fb45 into 2.x Apr 1, 2023
70 checks passed
@jrfnl jrfnl deleted the feature/tests-add-separate-testconfig-for-phpunit-10 branch April 1, 2023 14:04
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.

None yet

1 participant