Add bc layer for older php and phpunit versions
This commit is contained in:
parent
8837f4b115
commit
7474bf936f
16 changed files with 90 additions and 99 deletions
|
|
@ -2,26 +2,28 @@
|
|||
|
||||
namespace Tests\FFMpeg\Unit\FFProbe;
|
||||
|
||||
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
|
||||
use FFMpeg\Exception\RuntimeException;
|
||||
use Tests\FFMpeg\Unit\TestCase;
|
||||
use FFMpeg\FFProbe\OptionsTester;
|
||||
|
||||
class OptionsTesterTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedExceptionMessage Your FFProbe version is too old and does not support `-help` option, please upgrade.
|
||||
*/
|
||||
public function testHasOptionWithOldFFProbe()
|
||||
{
|
||||
$this->expectException('\FFMpeg\Exception\RuntimeException');
|
||||
$this->expectException(
|
||||
'\FFMpeg\Exception\RuntimeException',
|
||||
'Your FFProbe version is too old and does not support `-help` option, please upgrade.'
|
||||
);
|
||||
$cache = $this->getCacheMock();
|
||||
|
||||
$executionFailerExceptionMock = $this->getMockBuilder('Alchemy\BinaryDriver\Exception\ExecutionFailureException')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$ffprobe = $this->getFFProbeDriverMock();
|
||||
$ffprobe->expects($this->once())
|
||||
->method('command')
|
||||
->with(array('-help', '-loglevel', 'quiet'))
|
||||
->will($this->throwException(new RuntimeException('Failed to execute')));
|
||||
->will($this->throwException($executionFailerExceptionMock));
|
||||
|
||||
$tester = new OptionsTester($ffprobe, $cache);
|
||||
$tester->has('-print_format');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue