Yoast / PHPUnit-Polyfills

Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
BSD 3-Clause "New" or "Revised" License
173 stars 13 forks source link

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

Closed jrfnl closed 7 months ago

jrfnl commented 7 months ago

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:

coveralls commented 7 months ago

Coverage Status

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

jrfnl commented 7 months ago

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.