Fix #44 : throw an exception in case of older ffprobe

This commit is contained in:
Romain Neutron 2013-07-03 20:53:12 +02:00
commit 3bdb341abb
2 changed files with 26 additions and 1 deletions

View file

@ -2,11 +2,30 @@
namespace FFMpeg\Tests\FFProbe;
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
use FFMpeg\Tests\TestCase;
use FFMpeg\FFProbe\OptionsTester;
class OptionsTesterTest extends TestCase
{
/**
* @expectedException FFMpeg\Exception\RuntimeException
* @expectedExceptionMessage Your FFProbe version is too old and does not support `-help` option, please upgrade.
*/
public function testHasOptionWithOldFFProbe()
{
$cache = $this->getCacheMock();
$ffprobe = $this->getFFProbeDriverMock();
$ffprobe->expects($this->once())
->method('command')
->with(array('-help', '-loglevel', 'quiet'))
->will($this->throwException(new ExecutionFailureException('Failed to execute')));
$tester = new OptionsTester($ffprobe, $cache);
$tester->has('-print_format');
}
/**
* @dataProvider provideOptions
*/