|
Ran
|
Jobs
31
|
Files
40
|
Run time
7min
|
Badge
README BADGES
|
push
github
PHPUnit 11.5.0 | AssertContainsOnly trait: polyfill the Assert::assertContains[Not]Only*() methods (#225) PHPUnit 11.5.0 introduced a range of new assertions. These assertions are specialized alternatives to the pre-existing `assert[Not]ContainsOnly()` methods, which are now soft deprecated and will be removed in PHPUnit 13.0. This commit: * Adds two traits with the same name. One to polyfill the methods when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available. * Adds logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. Most polyfilled methods can just fall-through to the pre-existing methods as a polyfill. The exceptions to this rule are: * `assertContains[Not]OnlyIterable()` which needs custom logic for PHPUnit < 7.1.0 in which the PHP native `iterable` type was not yet supported. * `assertContains[Not]OnlyClosedResource()` which needs custom logic for PHP < 7.2 in which the PHP native `resource (closed)` type did not exist yet. In this last case, the custom logic is used for the polyfill on all PHP versions as there is no functional check (in contrast to a version check) which can be used to determine whether the `resource (closed)` type is available. All new methods are loosely tested. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. Refs: * https://github.com/sebastianbergmann/phpunit/commit/a726e0396 Fixes 214
133 of 133 new or added lines in 1 file covered. (100.0%)
797 of 814 relevant lines covered (97.91%)
127.58 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|