Set PhpUnit version for older php

This commit is contained in:
Alexander Schranz 2020-02-14 09:08:50 +01:00
commit 8837f4b115
6 changed files with 76 additions and 23 deletions

60
tests/BaseTestCase.php Normal file
View file

@ -0,0 +1,60 @@
<?php
namespace Tests\FFMpeg;
use PHPUnit\Framework\TestCase;
class BaseTestCase extends TestCase
{
public function assertScalar($value, $message = '')
{
$this->assertTrue(is_scalar($value), $message);
}
/**
* Can be removed when phpunit 4.8 (<= needed for php 5.5) support is removed.
*/
public function assertIsArray($value, $message = '')
{
$this->assertTrue(is_array($value), $message);
}
/**
* Can be removed when phpunit 4.8 (<= needed for php 5.5) support is removed.
*/
public function assertIsInt($value, $message = '')
{
$this->assertTrue(is_int($value), $message);
}
/**
* Can be removed when phpunit 4.8 (<= needed for php 5.5) support is removed.
*/
public function assertIsBool($value, $message = '')
{
$this->assertTrue(is_bool($value), $message);
}
/**
* Can be removed when phpunit 4.8 (<= needed for php 5.5) support is removed.
*/
public function assertIsString($value, $message = '')
{
$this->assertTrue(is_string($value), $message);
}
/**
* Can be removed when phpunit 4.8 (<= needed for php 5.5) support is removed.
*/
public function expectException($exception)
{
// PHPUnt BC Layer
if (method_exists(get_parent_class(), 'expectException')) {
parent::expectException($exception);
return;
}
$this->setExpectedException($exception);
}
}

View file

@ -3,9 +3,9 @@
namespace Tests\FFMpeg\Functional;
use FFMpeg\FFMpeg;
use PHPUnit\Framework\TestCase;
use Tests\FFMpeg\BaseTestCase;
abstract class FunctionalTestCase extends TestCase
abstract class FunctionalTestCase extends BaseTestCase
{
/**
* @return FFMpeg

View file

@ -4,9 +4,8 @@ namespace Tests\FFMpeg\Unit;
use FFMpeg\FFMpegServiceProvider;
use Silex\Application;
use PHPUnit\Framework\TestCase as BaseTestCase;
class FFMpegServiceProviderTest extends BaseTestCase
class FFMpegServiceProviderTest extends TestCase
{
public function testWithConfig()
{

View file

@ -2,15 +2,10 @@
namespace Tests\FFMpeg\Unit;
use PHPUnit\Framework\TestCase as BaseTestCase;
use Tests\FFMpeg\BaseTestCase;
class TestCase extends BaseTestCase
{
public function assertScalar($value)
{
$this->assertTrue(is_scalar($value));
}
public function getLoggerMock()
{
return $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();