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

Yoast / PHPUnit-Polyfills / 10706436946
98%
3.x: 98%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: 3.x
Ran 04 Sep 2024 05:17PM UTC
Jobs 28
Files 38
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Sep 2024 05:15PM UTC coverage: 97.504%. Remained the same
10706436946

push

github

jrfnl
PHPUnit 11 | ExpectUserDeprecationtrait: polyfill the TestCase::expectUserDeprecation*() methods

PHPUnit 11.0.0 introduces the new `TestCase::expectUserDeprecationMessage()` and `TestCase::expectUserDeprecationMessageMatches()` methods.

These methods can largely be seen as replacements for the `TestCase::expectDeprecationMessage()` and `TestCase::expectDeprecationMessageMatches()` methods which were removed in PHPUnit 10.0, though there are significant differences between the implementation details of the old vs the new methods.

As PHPUnit 10 does not have any even semi-equivalent method(s) available, the challenge was to polyfill these methods for PHPUnit 10.
And as these methods are expectation methods, not assertions, this is even more challenging as the information to evaluate a pass/fail is not available at the time of the method call, but only once the rest of the test code has run.

To do so, the following five options were considered:

**Option 1: evaluate pass/fail in an "assertPostConditions()" method**

While possible, doing so would make the use of the `Yoast\PHPUnitPolyfills\TestCases\TestCase` base class required.
It would also mean deprecating/removing the annotation-based `Yoast\PHPUnitPolyfills\TestCases\XTestCase` class as there is no annotation available to mark a method as an "assertPostConditions()"  method, so the functionality could not work with the `XTestCase` class.

As a knock-on effect of making the use of the Polyfilled `TestCase` a requirement, it would also mean that using of the individual Polyfills as stand-alone traits should be deprecated/no longer be supported.

This chain of consequences was deemed undesirable as it breaks the premise of the Polyfills being a "drop in" helper library.

**Option 2: use Events to evaluate pass/fail**

While possible, doing so would mean that the event listeners would need to be "hooked in" from the PHPUnit config file.
This would mean that every project using the Polyfills and wan... (continued)

16 of 16 new or added lines in 1 file covered. (100.0%)

664 of 681 relevant lines covered (97.5%)

143.08 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-8.0-phpunit-auto - 10706436946.1 04 Sep 2024 05:17PM UTC 38
46.0
GitHub Action Run
2 php-7.1-phpunit-auto - 10706436946.2 04 Sep 2024 05:17PM UTC 38
65.39
GitHub Action Run
3 php-7.2-phpunit-phar-8.0 - 10706436946.3 04 Sep 2024 05:17PM UTC 38
65.75
GitHub Action Run
4 php-7.4-phpunit-phar-8 - 10706436946.4 04 Sep 2024 05:17PM UTC 38
62.23
GitHub Action Run
5 php-7.0-phpunit-auto - 10706436946.5 04 Sep 2024 05:17PM UTC 38
80.99
GitHub Action Run
6 php-7.3-phpunit-auto - 10706436946.6 04 Sep 2024 05:17PM UTC 38
46.68
GitHub Action Run
7 php-8.3-phpunit-phar-11 - 10706436946.7 04 Sep 2024 05:17PM UTC 38
3.94
GitHub Action Run
8 php-7.3-phpunit-phar-9.0 - 10706436946.8 04 Sep 2024 05:17PM UTC 38
61.04
GitHub Action Run
9 php-8.0-phpunit-9.3.0 - 10706436946.9 04 Sep 2024 05:17PM UTC 38
58.43
GitHub Action Run
10 php-7.3-phpunit-7.2.7 - 10706436946.10 04 Sep 2024 05:17PM UTC 38
81.64
GitHub Action Run
11 php-7.2-phpunit-auto - 10706436946.11 04 Sep 2024 05:17PM UTC 38
61.47
GitHub Action Run
12 php-8.1-phpunit-9.3.0 - 10706436946.12 04 Sep 2024 05:17PM UTC 38
58.43
GitHub Action Run
13 php-8.3-phpunit-11.0.0 - 10706436946.13 04 Sep 2024 05:17PM UTC 38
19.05
GitHub Action Run
14 php-7.1-phpunit-~6.4.4 - 10706436946.14 04 Sep 2024 05:18PM UTC 38
81.14
GitHub Action Run
15 php-8.1-phpunit-auto - 10706436946.15 04 Sep 2024 05:17PM UTC 38
46.0
GitHub Action Run
16 php-7.2-phpunit-phar-6 - 10706436946.16 04 Sep 2024 05:18PM UTC 38
81.48
GitHub Action Run
17 php-7.0-phpunit-6.4.4 - 10706436946.17 04 Sep 2024 05:17PM UTC 38
80.99
GitHub Action Run
18 php-7.4-phpunit-8.1.6 - 10706436946.18 04 Sep 2024 05:17PM UTC 38
66.06
GitHub Action Run
19 php-8.2-phpunit-phar-11.0 - 10706436946.19 04 Sep 2024 05:17PM UTC 38
19.05
GitHub Action Run
20 php-7.4-phpunit-9.6.10 - 10706436946.20 04 Sep 2024 05:17PM UTC 38
55.54
GitHub Action Run
21 php-7.3-phpunit-phar-7 - 10706436946.21 04 Sep 2024 05:17PM UTC 38
66.06
GitHub Action Run
22 php-8.2-phpunit-~11.1.0 - 10706436946.22 04 Sep 2024 05:17PM UTC 38
19.05
GitHub Action Run
23 php-8.3-phpunit-phar-9 - 10706436946.23 04 Sep 2024 05:17PM UTC 38
46.17
GitHub Action Run
24 php-8.2-phpunit-auto - 10706436946.24 04 Sep 2024 05:17PM UTC 38
3.94
GitHub Action Run
25 php-7.4-phpunit-auto - 10706436946.25 04 Sep 2024 05:18PM UTC 38
46.85
GitHub Action Run
26 php-7.2-phpunit-~7.1.0 - 10706436946.26 04 Sep 2024 05:17PM UTC 38
81.33
GitHub Action Run
27 php-8.2-phpunit-9.3.0 - 10706436946.27 04 Sep 2024 05:17PM UTC 38
58.43
GitHub Action Run
28 php-8.3-phpunit-auto - 10706436946.28 04 Sep 2024 05:17PM UTC 38
3.94
GitHub Action Run
Source Files on build 10706436946
  • Tree
  • List 38
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #10706436946
  • 7e6355b7 on github
  • Prev Build on WIP/3.x (#10706155058)
  • Next Build on WIP/3.x (#10706891309)
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

© 2026 Coveralls, Inc