Added the BC Layer alias for some phpunit methods to fix build at php <= 5.5.

This commit is contained in:
CaliforniaMountainSnake 2020-02-27 20:59:26 +03:00
commit 71766fed47
3 changed files with 39 additions and 3 deletions

View file

@ -8,7 +8,8 @@ use PHPUnit\Framework\TestCase;
* This is a BC Layer to support phpunit 4.8 needed for php <= 5.5.
*/
if (class_exists('PHPUnit_Runner_Version')
&& version_compare(\PHPUnit_Runner_Version::id(), '5', '<')) {
&& version_compare(\PHPUnit_Runner_Version::id(), '5', '<')
) {
class BaseTestCase extends TestCase
{
public static function assertScalar($value, $message = '')
@ -40,6 +41,16 @@ if (class_exists('PHPUnit_Runner_Version')
{
$this->setExpectedException($exception, $message);
}
public static function assertStringContainsString($needle, $haystack, $message = '')
{
self::assertContains($needle, $haystack, $message);
}
public static function assertStringNotContainsString($needle, $haystack, $message = '')
{
self::assertNotContains($needle, $haystack, $message);
}
}
} else {
class BaseTestCase extends TestCase