BrainMonkey
BrainMonkey copied to clipboard
UnitTestCase: bug fix - referencing non-existant PHPUnit classes
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_Errorclass 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.