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.
coverage: 97.276% (+0.1%) from 97.152%
when pulling 318912302c43c54d6bc64f9f44b94043bc90a5c1 on feature/3.x/new-assertarraywithlistkeys-polyfill-trait
into 5aa05612c0a15e0b20d41ceff47c2a48c52f4801 on 3.x.
PHPUnit 11.0.0 introduces the new
Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys()
,Assert::assertArrayIsEqualToArrayIgnoringListOfKeys()
,Assert::assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()
andAssert::assertArrayIsIdenticalToArrayIgnoringListOfKeys()
methods.This commit:
use
-ing the trait in PHPUnit versions in which the methods are already natively available.Includes:
TestCases
classes.Refs: