Allow use of FFProbe on remote files
This commit is contained in:
parent
878eda920e
commit
69767d3d34
3 changed files with 35 additions and 19 deletions
29
tests/FFMpeg/Functional/FFProbeTest.php
Normal file
29
tests/FFMpeg/Functional/FFProbeTest.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace FFMpeg\Functional;
|
||||
|
||||
use FFMpeg\FFProbe;
|
||||
|
||||
class FFProbeTest extends FunctionalTestCase
|
||||
{
|
||||
public function testProbeOnFile()
|
||||
{
|
||||
$ffprobe = FFProbe::create();
|
||||
$this->assertGreaterThan(0, count($ffprobe->streams(__DIR__ . '/../../files/Audio.mp3')));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException FFMpeg\Exception\RuntimeException
|
||||
*/
|
||||
public function testProbeOnUnexistantFile()
|
||||
{
|
||||
$ffprobe = FFProbe::create();
|
||||
$ffprobe->streams('/path/to/no/file');
|
||||
}
|
||||
|
||||
public function testProbeOnRemoteFile()
|
||||
{
|
||||
$ffprobe = FFProbe::create();
|
||||
$this->assertGreaterThan(0, count($ffprobe->streams('http://video-js.zencoder.com/oceans-clip.mp4')));
|
||||
}
|
||||
}
|
||||
|
|
@ -228,18 +228,6 @@ class FFProbeTest extends TestCase
|
|||
$this->assertEquals($output, call_user_func(array($ffprobe, $method), $pathfile));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException FFMpeg\Exception\InvalidArgumentException
|
||||
* @dataProvider provideProbeMethod
|
||||
*/
|
||||
public function testProbeWithInvalidFile($method)
|
||||
{
|
||||
$pathfile = '/path/to/nofile';
|
||||
|
||||
$ffprobe = new FFProbe($this->getFFProbeDriverMock(), $this->getCacheMock());
|
||||
call_user_func(array($ffprobe, $method), $pathfile);
|
||||
}
|
||||
|
||||
public function provideProbeMethod()
|
||||
{
|
||||
return array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue