[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
This commit is contained in:
parent
72c946dc7d
commit
111c153428
335 changed files with 4394 additions and 28116 deletions
49
tests/FFMpeg/Unit/Driver/FFMpegDriverTest.php
Normal file
49
tests/FFMpeg/Unit/Driver/FFMpegDriverTest.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\FFMpeg\Unit\Driver;
|
||||
|
||||
use Alchemy\BinaryDriver\Configuration;
|
||||
use FFMpeg\Driver\FFMpegDriver;
|
||||
use Symfony\Component\Process\ExecutableFinder;
|
||||
use Tests\FFMpeg\Unit\TestCase;
|
||||
|
||||
class FFMpegDriverTest extends TestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
$executableFinder = new ExecutableFinder();
|
||||
|
||||
$found = false;
|
||||
foreach (['avconv', 'ffmpeg'] as $name) {
|
||||
if (null !== $executableFinder->find($name)) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$this->markTestSkipped('Neither ffmpeg or avconv found');
|
||||
}
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$logger = $this->getLoggerMock();
|
||||
$ffmpeg = FFMpegDriver::create($logger, []);
|
||||
$this->assertInstanceOf('FFMpeg\Driver\FFMpegDriver', $ffmpeg);
|
||||
$this->assertEquals($logger, $ffmpeg->getProcessRunner()->getLogger());
|
||||
}
|
||||
|
||||
public function testCreateWithConfig()
|
||||
{
|
||||
$conf = new Configuration();
|
||||
$ffmpeg = FFMpegDriver::create($this->getLoggerMock(), $conf);
|
||||
$this->assertEquals($conf, $ffmpeg->getConfiguration());
|
||||
}
|
||||
|
||||
public function testCreateFailureThrowsAnException()
|
||||
{
|
||||
$this->expectException('\FFMpeg\Exception\ExecutableNotFoundException');
|
||||
FFMpegDriver::create($this->getLoggerMock(), ['ffmpeg.binaries' => '/path/to/nowhere']);
|
||||
}
|
||||
}
|
||||
49
tests/FFMpeg/Unit/Driver/FFProbeDriverTest.php
Normal file
49
tests/FFMpeg/Unit/Driver/FFProbeDriverTest.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\FFMpeg\Unit\Driver;
|
||||
|
||||
use Alchemy\BinaryDriver\Configuration;
|
||||
use FFMpeg\Driver\FFProbeDriver;
|
||||
use Symfony\Component\Process\ExecutableFinder;
|
||||
use Tests\FFMpeg\Unit\TestCase;
|
||||
|
||||
class FFProbeDriverTest extends TestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
$executableFinder = new ExecutableFinder();
|
||||
|
||||
$found = false;
|
||||
foreach (['avprobe', 'ffprobe'] as $name) {
|
||||
if (null !== $executableFinder->find($name)) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$this->markTestSkipped('Neither ffprobe or avprobe found');
|
||||
}
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$logger = $this->getLoggerMock();
|
||||
$ffprobe = FFProbeDriver::create([], $logger);
|
||||
$this->assertInstanceOf('FFMpeg\Driver\FFProbeDriver', $ffprobe);
|
||||
$this->assertEquals($logger, $ffprobe->getProcessRunner()->getLogger());
|
||||
}
|
||||
|
||||
public function testCreateWithConfig()
|
||||
{
|
||||
$conf = new Configuration();
|
||||
$ffprobe = FFProbeDriver::create($conf, $this->getLoggerMock());
|
||||
$this->assertEquals($conf, $ffprobe->getConfiguration());
|
||||
}
|
||||
|
||||
public function testCreateFailureThrowsAnException()
|
||||
{
|
||||
$this->expectException('\FFMpeg\Exception\ExecutableNotFoundException');
|
||||
FFProbeDriver::create(['ffprobe.binaries' => '/path/to/nowhere']);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue