Add FFProbe#isValid

fixes #394
This commit is contained in:
jens1o 2017-09-19 19:28:34 +02:00
commit 74a1d6539c
No known key found for this signature in database
GPG key ID: C7437FC1B445CC49
2 changed files with 33 additions and 1 deletions

View file

@ -12,10 +12,23 @@ class FFProbeTest extends FunctionalTestCase
$this->assertGreaterThan(0, count($ffprobe->streams(__DIR__ . '/../files/Audio.mp3')));
}
public function testValidateExistingFile()
{
$ffprobe = FFProbe::create();
$this->assertTrue($ffprobe->isValid(__DIR__ . '/../files/sample.3gp'));
}
public function testValidateNonExistingFile()
{
$ffprobe = FFProbe::create();
$this->assertFalse($ffprobe->isValid(__DIR__ . '/../files/WrongFile.mp4'));
}
/**
* @expectedException FFMpeg\Exception\RuntimeException
*/
public function testProbeOnUnexistantFile()
public function testProbeOnNonExistantFile()
{
$ffprobe = FFProbe::create();
$ffprobe->streams('/path/to/no/file');