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

AssertClosedResource: fix compatibility with PHPUnit 8/9 PHAR files #161

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Apr 5, 2024

PHPUnit 8.5.38 and 9.6.19 contain a change in the PHAR files. In particular, a change in how external dependencies included in the packaged PHAR files are prefixed to prevent conflicts with potentially Composer installed dependencies on the same packages.

In practice, the prefix for these external dependencies which is being added when the PHAR is being build has changed from PHPUnit\\ to PHPUnitPHAR\\.

This impacts the AssertClosedResource polyfill which uses the SebastianBergmann\Exporter\Exporter class from the external Exporter dependency.

This commit fixes the issue.

Refs:

PHPUnit 8.5..38 and 9.6.19 contain a change in the PHAR files. In particular, a change in how external dependencies included in the packaged PHAR files are prefixed to prevent conflicts with potentially Composer installed dependencies on the same packages.

In practice, the prefix for these external dependencies which is being added when the PHAR is being build has changed from `PHPUnit\\` to `PHPUnitPHAR\\`.

This impacts the `AssertClosedResource` polyfill which uses the `SebastianBergmann\Exporter\Exporter` class from the external `Exporter` dependency.

This commit fixes the issue.

Refs:
* https:/sebastianbergmann/phpunit/releases/tag/8.5.38
* https:/sebastianbergmann/phpunit/releases/tag/9.6.19
@coveralls
Copy link

Coverage Status

coverage: 95.833% (-0.4%) from 96.232%
when pulling ee15e22 on feature/support-phpunit-8.5.38-9.6.19
into 3380dcc on 1.x.

@jrfnl
Copy link
Collaborator Author

jrfnl commented Apr 5, 2024

Note: decrease in code coverage is as expected as the lines which are specific for use with PHPUnit PHAR files are not currently run in CI.

@jrfnl jrfnl merged commit 51c2415 into 1.x Apr 5, 2024
86 checks passed
@jrfnl jrfnl deleted the feature/support-phpunit-8.5.38-9.6.19 branch April 5, 2024 13:56
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.

2 participants