Tests: polyfill the PHPUnit `expectException()` method
Tests: polyfill the PHPUnit `expectException()` method

This selectively polyfills the PHPUnit native `expectException()` method.

Context:
The `@expectedException` annotations are deprecated in PHPUnit 8 and no longer supported in PHPUnit 9.

PHPUnit 9 is needed to be able to run the tests on PHP 8 (expected end of November 2020), so making the test suite compatible with PHPUnit 9 is a good idea.

Rationale for the three different test cases:
* The `expectException()` method was introduced in PHPUnit 5.
* A forward compatibility layer for the namespaced `PHPUnit\Framework\TestCase` class is included in some of the last versions of PHPUnit 4.x and 5.x and the namespaced `TestCase` is the official and only supported `TestCase` as of PHPUnit 6.0.
* PHPUnit 8 added type declarations to various PHPUnit methods, including the `string` type declaration for the `$exception` parameter and a `void` return type declaration for this method.
* Overloading the method with the type declarations is not possible as the `void` return type wasn't introduced until PHP 7.1, so that would break the test suite on PHP < 7.1.
* As these type declarations cause an "incompatible signature" error if we'd overload the method in the `TestBase` class without the type declarations, the overload needs to be done in the `TestCaseBase` class, but only for those classes were the `expectException()` method isn't natively declared in PHPUnit to prevent the signature mismatch.

mck89/peast,mck89/peast