ffmpeg-mappable-media/tests/FFMpeg/Functional/FFProbeTest.php

41 lines
1 KiB
PHP
Raw Normal View History

2013-08-05 14:36:27 +02:00
<?php
namespace Tests\FFMpeg\Functional;
2013-08-05 14:36:27 +02:00
use FFMpeg\FFProbe;
class FFProbeTest extends FunctionalTestCase
{
public function testProbeOnFile()
{
$ffprobe = FFProbe::create();
$this->assertGreaterThan(0, count($ffprobe->streams(__DIR__.'/../files/Audio.mp3')));
2013-08-05 14:36:27 +02:00
}
2017-09-19 19:28:34 +02:00
public function testValidateExistingFile()
{
$ffprobe = FFProbe::create();
$this->assertTrue($ffprobe->isValid(__DIR__.'/../files/sample.3gp'));
2017-09-19 19:28:34 +02:00
}
public function testValidateNonExistingFile()
{
$ffprobe = FFProbe::create();
$this->assertFalse($ffprobe->isValid(__DIR__.'/../files/WrongFile.mp4'));
2017-09-19 19:28:34 +02:00
}
public function testProbeOnNonExistantFile()
2013-08-05 14:36:27 +02:00
{
$this->expectException('\FFMpeg\Exception\RuntimeException');
2013-08-05 14:36:27 +02:00
$ffprobe = FFProbe::create();
$ffprobe->streams('/path/to/no/file');
}
public function testProbeOnRemoteFile()
{
$ffprobe = FFProbe::create();
2016-03-05 18:03:41 +01:00
$this->assertGreaterThan(0, count($ffprobe->streams('http://vjs.zencdn.net/v/oceans.mp4')));
2013-08-05 14:36:27 +02:00
}
}