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

Allow the polyfill to kick in with PHPUnit 8.x #65

Merged
merged 2 commits into from
Feb 13, 2022

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Dec 27, 2021

PHPUnit 8.x deprecated the assertArraySubset() functionality, PHPUnit 9.x removed it.

Up to now, this package would only "kick in" in combination with PHPUnit 9.x to polyfill the functionality.

The combined changes in this commit will allow for this package to also "kick in" in combination with PHPUnit 8.x, preventing the PHPUnit native deprecation for using assertArraySubset() from being thrown.

This commit also includes CI changes to safeguard the correct functioning of the code when used with PHPUnit 8.x.

Notes:

  • The main change is in the autoloader, most other files only contain changed annotations.
  • The only functional change needed was a work-around for the PHPUnit InvalidArgumentException, which was only introduced in PHPUnit 8.4.0.
  • This commit does change the minimum PHP version code within the actual polyfill has to be compatible with.
    Previously, the code has to be compatible with PHP 7.3 and higher (minimum supported PHP version for PHPUnit 9.x).
    Now, the code has to be compatible with PHP 7.2 and higher (minimum supported PHP version for PHPUnit 8.x).

Fixes #50

PHPUnit 8.x deprecated the `assertArraySubset()` functionality, PHPUnit 9.x removed it.

Up to now, this package would only "kick in" in combination with PHPUnit 9.x to polyfill the functionality.

The combined changes in this commit will allow for this package to also "kick in" in combination with PHPUnit 8.x, preventing the PHPUnit native deprecation for using `assertArraySubset()` from being thrown.

This commit also includes CI changes to safeguard the correct functioning of the code when used with PHPUnit 8.x.

Notes:
* The main change is in the autoloader, most other files only contain changed annotations.
* The only functional change needed was a work-around for the PHPUnit `InvalidArgumentException`, which was only introduced in PHPUnit 8.4.0.
* This commit does change the minimum PHP version code within the actual polyfill has to be compatible with.
    Previously, the code has to be compatible with PHP 7.3 and higher (minimum supported PHP version for PHPUnit 9.x).
    Now, the code has to be compatible with PHP **7.2** and higher (minimum supported PHP version for PHPUnit 8.x).

Fixes 50
@jrfnl jrfnl mentioned this pull request Dec 27, 2021
@rdohms rdohms added the Feature New feature or request label Feb 13, 2022
@rdohms rdohms added this to the v0.4.0 milestone Feb 13, 2022
@rdohms rdohms merged commit 428293c into rdohms:master Feb 13, 2022
@jrfnl jrfnl deleted the feature/50-prevent-warnings-on-phpunit-50 branch February 13, 2022 15:23
@jrfnl jrfnl mentioned this pull request Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work on PHPUnit 8
3 participants