• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / PHPUnit-Polyfills / 8548419439

04 Apr 2024 02:28AM UTC coverage: 96.232% (-1.0%) from 97.254%
8548419439

push

github

jrfnl
Tests: minor tweaks to work round PHP 8.4 deprecation

PHP 8.4 deprecates implicitly nullable parameters, i.e. typed parameter with a `null` default value, which are not explicitly declared as nullable.

The `ValueObject` fixture used in these tests used one such implicitly nullable parameters.

The tests for the `AssertObjectEquals` trait already needed two test classes to allow the method to be fully tests cross-version:
* One set which was run on PHPUnit < 9.4.0.
* One set which runs against PHP 7.0+.

As the nullability operator was introduced in PHP 7.1 and the particular test affected _does_ need to be typed to still test what it is supposed to test, I'm changing the requirements both test sets:
* The requirement for the first set of tests will now be PHPUnit < 9.4.0 AND PHP < 8.4.
* The requirement for the second set of test will now be PHP 7.1+.

This way the tests still covers the trait sufficiently.

_Note: the trait itself is not affected by the deprecation._

664 of 690 relevant lines covered (96.23%)

60.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Exceptions/TypeError.php
1
<?php
2

3
/**
4
 * Polyfill the PHP 7.0+ native TypeError class.
5
 *
6
 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
7
 */
8
class TypeError extends Error {}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc