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

PHPUnit 11 | AssertArrayWithListKeys trait: polyfill the Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys() et al methods #198

Merged

Commits on Sep 6, 2024

  1. PHPUnit 11 | AssertArrayWithListKeys trait: polyfill the Assert::asse…

    …rtArrayIsEqualToArrayOnlyConsideringListOfKeys() et al methods
    
    PHPUnit 11.0.0 introduces the new `Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys()`, `Assert::assertArrayIsEqualToArrayIgnoringListOfKeys()`, `Assert::assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()` and `Assert::assertArrayIsIdenticalToArrayIgnoringListOfKeys()` methods.
    
    This commit:
    * Adds two traits with the same name.
        One to polyfill the methods when not available in PHPUnit.
        The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available.
    * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used.
    * An availability test and limited functional tests for the functionality polyfilled.
    
    Includes:
    * Adding the new polyfill to the existing `TestCases` classes.
    
    Refs:
    * sebastianbergmann/phpunit 5600
    * sebastianbergmann/phpunit 5716
    * sebastianbergmann/phpunit 5729
    
    Co-authored-by: Sebastian Bergmann <[email protected]>
    jrfnl and sebastianbergmann committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    3189123 View commit details
    Browse the repository at this point in the history