BrainMonkey icon indicating copy to clipboard operation
BrainMonkey copied to clipboard

UnitTestCase: bug fix - referencing non-existant PHPUnit classes

Open jrfnl opened this issue 1 month ago • 0 comments

The UnitTestCase::tearDownMakingSureExpectedExceptionIsThrown() method, as well as the UnitTestCase::expectMockeryException() method, both reference PHPUnit classes using their PHPUnit 5 class name, while these classes no longer exist since PHPUnit 6.0.

This commit adds a toggle to allow the functionality in these methods to work PHPUnit cross-version.

Notes:

  • I did check the test bootstrap and while the PHPUnit_Framework_Error class is aliased there, the classes referenced in these methods are not.
  • And as support for PHP < 7.2/PHPUnit < 8 will be dropped in the foreseeable future, I've applied the most straight-forward fix and not added aliases in the test bootstrap file.

jrfnl avatar Dec 07 '25 16:12 jrfnl