Composer/GH Actions: allow for PHPUnit 11.x #196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PHPUnit 11.0 has been released on Feb 2, 2024.
As the PHPUnit Polyfills, as of now, will officially support PHPUnit 11.x (with the exception of the TestListeners), the GH Actions workflow should be updated to reflect this.
This commit:
composer.json
require
.auto
setting in combination with the Composer PHPUnit version requirements being widened.Regarding PHPUnit 11 and running code coverage:
Since PHPUnit 10, PHPUnit did not distinguish between PHPUnit and PHP deprecation notices anymore. This means that when
failOnDeprecation
is enabled (as is done for this library to be ready early for new PHP versions), a test run will also fail if there are PHPUnit native deprecation notices.Now PHPUnit 11.2 deprecated the use of
#[CoversClass]
for traits and introduced a#[CoversTrait]
attribute to replace this. However, it is currently impossible to action this deprecation notice in a PHPUnit cross-version compatible manner. This was reported upstream in sebastianbergmann/phpunit 5937As a result of this report, PHPUnit, as of PHPUnit 10.5.32 and PHPUnit 11.3.3 will no longer exit with a non-zero exit code when
failOnDeprecation
is enabled and the only deprecations are PHPUnit native deprecations.The net-effect of this is as follows:
CoversClass
for traits, the exit code would be non-zero.Refs: