ffmpeg-mappable-media/tests/FFMpeg/Functional/FFProbeTest.php
Pascal Baljet 111c153428
[BC] Upgraded dependencies, dropped support for anything below PHP 8.0. (#849)
* GitHub actions + style fixes + updated packages

* Fixed workflows dir

* Support for PHP 8.1 (#1)

* Update README.md

* Revert some changes from upstream
2022-02-09 14:32:43 +01:00

40 lines
1 KiB
PHP

<?php
namespace Tests\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')));
}
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'));
}
public function testProbeOnNonExistantFile()
{
$this->expectException('\FFMpeg\Exception\RuntimeException');
$ffprobe = FFProbe::create();
$ffprobe->streams('/path/to/no/file');
}
public function testProbeOnRemoteFile()
{
$ffprobe = FFProbe::create();
$this->assertGreaterThan(0, count($ffprobe->streams('http://vjs.zencdn.net/v/oceans.mp4')));
}
}