sebastianbergmann / phpunit

The PHP Unit Testing framework.
https://phpunit.de/
BSD 3-Clause "New" or "Revised" License
19.71k stars 2.2k forks source link

PHPUnit\Framework\TestFailure Class is missing in version 10 #5227

Closed MiroslavRusev closed 1 year ago

MiroslavRusev commented 1 year ago
Q A
PHPUnit version 10.0.9
PHP version 8.1.16
Installation Method Composer / PHAR

Summary

Current behavior

When using assertions in my class, if the assertion is false the error above is thrown. Comparing different PHPUnit versions and checking the code in /Testwork/Exception/Stringer/PHPUnitExceptionStringer.php line 38 seems that the problem is that TestFailure.php file is completely missing in version 10 - https://github.com/sebastianbergmann/phpunit/blob/9.6.3/src/Framework/TestFailure.php

How to reproduce

Use for example Assertions::assertEquals($val1,$val2) and provide different values for val1 and val2

Expected behavior

Not throwing php fatal error and instead returning formatted response like before.

sebastianbergmann commented 1 year ago

The class was removed, there is no bug here.

MiroslavRusev commented 1 year ago

Thanks for the answer, I just didn't see it in - https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-10.0.md