diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..3f36d28 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,66 @@ +name: Test + +on: + pull_request: ~ + push: + branches: + - "master" + schedule: + - cron: "0 0 * * *" + +jobs: + test: + name: "PHP ${{ matrix.php-version }} ${{ matrix.dependency-versions }} ${{ matrix.composer-stability }}" + runs-on: ubuntu-latest + + env: + PHPUNIT_VERSION: ${{ matrix.phpunit-version }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + php-version: [8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, 5.6, 5.5] + dependency-versions: [prefer-lowest, prefer-stable] + include: + - php-version: 5.5 + phpunit-version: 4 + + steps: + - name: Checkout project + uses: actions/checkout@v2 + + - name: Install and configure PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + coverage: none + + - name: Install phpunit + if: ${{ matrix.phpunit-version }} + run: | + composer remove symfony/phpunit-bridge --dev + wget -O phpunit "https://phar.phpunit.de/phpunit-${{ matrix.phpunit-version }}.phar" + chmod +x phpunit + composer require "roave/security-advisories" dev-master --no-update + + - name: Set composer stability + if: ${{ matrix.composer-stability }} + run: composer config minimum-stability ${{ matrix.composer-stability }} + + - name: Install composer dependencies + uses: ramsey/composer-install@v1 + with: + dependency-versions: ${{ matrix.dependency-versions }} + + - name: Install ffmpeg + uses: FedericoCarboni/setup-ffmpeg@v1 + + - name: Run tests + run: | + if [ "$PHPUNIT_VERSION" ]; then + ./phpunit --verbose + else + ./vendor/bin/simple-phpunit --verbose + fi; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 75f2db4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -language: php - -dist: trusty - -branches: - only: - - master - - v1.x - -cache: - directories: - - $HOME/.composer/cache - - $HOME/.cache - -matrix: - include: - - php: 5.4 - env: - - PHPUNIT_VERSION=4 - - COMPOSER_FLAGS="--prefer-lowest" - - php: 5.4 - env: - - PHPUNIT_VERSION=4 - - php: 5.5 - env: - - PHPUNIT_VERSION=4 - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - - php: 8.0 - dist: bionic - - php: nightly - env: - - COMPOSER_DEV_STABILITY=true - -before_install: - - sudo add-apt-repository ppa:mc3man/${TRAVIS_DIST}-media -y - - sudo apt-get update -q - - composer self-update - - echo "$PHPUNIT_VERSION" - - | - if [ "$PHPUNIT_VERSION" ]; then - composer remove symfony/phpunit-bridge --dev - wget -O phpunit "https://phar.phpunit.de/phpunit-$PHPUNIT_VERSION.phar" - chmod +x phpunit - fi; - - | - if [ "$COMPOSER_FLAGS" == "--prefer-lowest" ]; then - composer require "roave/security-advisories" dev-master --no-update - fi; - - | - if [ "$COMPOSER_DEV_STABILITY" == "true" ]; then - composer config minimum-stability dev - fi; - -install: - - sudo apt-get install -y ffmpeg - - composer update --prefer-dist $COMPOSER_FLAGS - -script: - - | - if [ "$PHPUNIT_VERSION" ]; then - ./phpunit --verbose - else - ./vendor/bin/simple-phpunit --verbose - fi; diff --git a/README.md b/README.md index 911fb64..58772de 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # php-ffmpeg -[![Build Status](https://secure.travis-ci.org/PHP-FFMpeg/PHP-FFMpeg.png?branch=master)](http://travis-ci.org/PHP-FFMpeg/PHP-FFMpeg) - -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/607f3111-e2d7-44e8-8bcc-54dd64521983/big.png)](https://insight.sensiolabs.com/projects/607f3111-e2d7-44e8-8bcc-54dd64521983) +[![Test](https://github.com/PHP-FFMpeg/PHP-FFMpeg/actions/workflows/test.yaml/badge.svg)](https://github.com/PHP-FFMpeg/PHP-FFMpeg/actions/workflows/test.yaml) An Object-Oriented library to convert video/audio files with FFmpeg / AVConv. @@ -714,32 +712,6 @@ $ffprobe = FFMpeg\FFProbe::create(); $ffprobe->isValid('/path/to/file/to/check'); // returns bool ``` -## Using with Silex Microframework - -The service provider is easy to set up: - -```php -$app = new Silex\Application(); -$app->register(new FFMpeg\FFMpegServiceProvider()); - -$video = $app['ffmpeg']->open('video.mpeg'); -``` - -Available options are as follow: - -```php -$app->register(new FFMpeg\FFMpegServiceProvider(), array( - 'ffmpeg.configuration' => array( - 'ffmpeg.threads' => 4, - 'ffmpeg.timeout' => 300, - 'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg', - 'ffprobe.timeout' => 30, - 'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe', - ), - 'ffmpeg.logger' => $logger, -)); -``` - ## License This project is licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/composer.json b/composer.json index 804bef9..8850836 100644 --- a/composer.json +++ b/composer.json @@ -32,17 +32,16 @@ } ], "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "alchemy/binary-driver": "^1.5 || ~2.0.0 || ^5.0", - "doctrine/cache": "^1.0", "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "neutron/temporary-filesystem": "^2.1.1 || ^3.0" + "neutron/temporary-filesystem": "^2.1.1 || ^3.0", + "symfony/cache": "^3.1 || ^4.0 || ^5.0 || ^6.0" }, "suggest": { "php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg" }, "require-dev": { - "silex/silex": "~1.0", "symfony/phpunit-bridge": "^5.0.4", "symfony/process": "2.8 || 3.3" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8b9403d..feaaa7b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,6 +12,7 @@ > + diff --git a/src/FFMpeg/FFMpegServiceProvider.php b/src/FFMpeg/FFMpegServiceProvider.php index 6aa9735..05d34e4 100644 --- a/src/FFMpeg/FFMpegServiceProvider.php +++ b/src/FFMpeg/FFMpegServiceProvider.php @@ -11,10 +11,13 @@ namespace FFMpeg; -use Doctrine\Common\Cache\ArrayCache; use Silex\Application; use Silex\ServiceProviderInterface; +use Symfony\Component\Cache\Adapter\ArrayAdapter; +/** + * @deprecated + */ class FFMpegServiceProvider implements ServiceProviderInterface { public function register(Application $app) @@ -44,7 +47,7 @@ class FFMpegServiceProvider implements ServiceProviderInterface }); $app['ffprobe.cache'] = $app->share(function () { - return new ArrayCache(); + return new ArrayAdapter; }); $app['ffmpeg.ffprobe'] = $app->share(function (Application $app) { diff --git a/src/FFMpeg/FFProbe.php b/src/FFMpeg/FFProbe.php index a1a0ba3..8eb7c66 100644 --- a/src/FFMpeg/FFProbe.php +++ b/src/FFMpeg/FFProbe.php @@ -13,27 +13,27 @@ namespace FFMpeg; use Alchemy\BinaryDriver\ConfigurationInterface; use Alchemy\BinaryDriver\Exception\ExecutionFailureException; -use Doctrine\Common\Cache\ArrayCache; -use Doctrine\Common\Cache\Cache; use FFMpeg\Driver\FFProbeDriver; +use FFMpeg\Exception\InvalidArgumentException; +use FFMpeg\Exception\RuntimeException; use FFMpeg\FFProbe\DataMapping\Format; +use FFMpeg\FFProbe\DataMapping\StreamCollection; use FFMpeg\FFProbe\Mapper; use FFMpeg\FFProbe\MapperInterface; use FFMpeg\FFProbe\OptionsTester; use FFMpeg\FFProbe\OptionsTesterInterface; use FFMpeg\FFProbe\OutputParser; use FFMpeg\FFProbe\OutputParserInterface; -use FFMpeg\Exception\InvalidArgumentException; -use FFMpeg\Exception\RuntimeException; -use FFMpeg\FFProbe\DataMapping\StreamCollection; +use Psr\Cache\CacheItemPoolInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\Cache\Adapter\ArrayAdapter; class FFProbe { const TYPE_STREAMS = 'streams'; const TYPE_FORMAT = 'format'; - /** @var Cache */ + /** @var CacheItemPoolInterface */ private $cache; /** @var OptionsTesterInterface */ private $optionsTester; @@ -44,7 +44,7 @@ class FFProbe /** @var MapperInterface */ private $mapper; - public function __construct(FFProbeDriver $ffprobe, Cache $cache) + public function __construct(FFProbeDriver $ffprobe, CacheItemPoolInterface $cache) { $this->ffprobe = $ffprobe; $this->optionsTester = new OptionsTester($ffprobe, $cache); @@ -114,11 +114,11 @@ class FFProbe } /** - * @param Cache $cache + * @param CacheItemPoolInterface $cache * * @return FFProbe */ - public function setCache(Cache $cache) + public function setCache(CacheItemPoolInterface $cache) { $this->cache = $cache; @@ -213,14 +213,14 @@ class FFProbe * * @param array|ConfigurationInterface $configuration * @param LoggerInterface $logger - * @param Cache $cache + * @param CacheItemPoolInterface $cache * * @return FFProbe */ - public static function create($configuration = array(), LoggerInterface $logger = null, Cache $cache = null) + public static function create($configuration = array(), LoggerInterface $logger = null, CacheItemPoolInterface $cache = null) { if (null === $cache) { - $cache = new ArrayCache(); + $cache = new ArrayAdapter(); } return new static(FFProbeDriver::create($configuration, $logger), $cache); @@ -228,10 +228,10 @@ class FFProbe private function probe($pathfile, $command, $type, $allowJson = true) { - $id = sprintf('%s-%s', $command, $pathfile); + $id = md5(sprintf('%s-%s', $command, $pathfile)); - if ($this->cache->contains($id)) { - return $this->cache->fetch($id); + if ($this->cache->hasItem($id)) { + return $this->cache->getItem($id)->get(); } if (!$this->optionsTester->has($command)) { @@ -276,7 +276,9 @@ class FFProbe $ret = $this->mapper->map($type, $data); - $this->cache->save($id, $ret); + $cacheItem = $this->cache->getItem($id); + $cacheItem->set($ret); + $this->cache->save($cacheItem); return $ret; } diff --git a/src/FFMpeg/FFProbe/DataMapping/AbstractData.php b/src/FFMpeg/FFProbe/DataMapping/AbstractData.php index 083e576..e830c8e 100644 --- a/src/FFMpeg/FFProbe/DataMapping/AbstractData.php +++ b/src/FFMpeg/FFProbe/DataMapping/AbstractData.php @@ -86,6 +86,7 @@ abstract class AbstractData implements \Countable /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function count() { return count($this->properties); diff --git a/src/FFMpeg/FFProbe/DataMapping/StreamCollection.php b/src/FFMpeg/FFProbe/DataMapping/StreamCollection.php index 409cf91..4b640e8 100644 --- a/src/FFMpeg/FFProbe/DataMapping/StreamCollection.php +++ b/src/FFMpeg/FFProbe/DataMapping/StreamCollection.php @@ -74,6 +74,7 @@ class StreamCollection implements \Countable, \IteratorAggregate /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function count() { return count($this->streams); @@ -92,6 +93,7 @@ class StreamCollection implements \Countable, \IteratorAggregate /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->streams); diff --git a/src/FFMpeg/FFProbe/OptionsTester.php b/src/FFMpeg/FFProbe/OptionsTester.php index a5cc885..1f95f3c 100644 --- a/src/FFMpeg/FFProbe/OptionsTester.php +++ b/src/FFMpeg/FFProbe/OptionsTester.php @@ -12,18 +12,18 @@ namespace FFMpeg\FFProbe; use Alchemy\BinaryDriver\Exception\ExecutionFailureException; -use Doctrine\Common\Cache\Cache; use FFMpeg\Driver\FFProbeDriver; use FFMpeg\Exception\RuntimeException; +use Psr\Cache\CacheItemPoolInterface; class OptionsTester implements OptionsTesterInterface { /** @var FFProbeDriver */ private $ffprobe; - /** @var Cache */ + /** @var CacheItemPoolInterface */ private $cache; - public function __construct(FFProbeDriver $ffprobe, Cache $cache) + public function __construct(FFProbeDriver $ffprobe, CacheItemPoolInterface $cache) { $this->ffprobe = $ffprobe; $this->cache = $cache; @@ -34,17 +34,19 @@ class OptionsTester implements OptionsTesterInterface */ public function has($name) { - $id = sprintf('option-%s', $name); + $id = md5(sprintf('option-%s', $name)); - if ($this->cache->contains($id)) { - return $this->cache->fetch($id); + if ($this->cache->hasItem($id)) { + return $this->cache->getItem($id)->get(); } $output = $this->retrieveHelpOutput(); $ret = (bool) preg_match('/^'.$name.'/m', $output); - $this->cache->save($id, $ret); + $cacheItem = $this->cache->getItem($id); + $cacheItem->set($ret); + $this->cache->save($cacheItem); return $ret; } @@ -53,8 +55,8 @@ class OptionsTester implements OptionsTesterInterface { $id = 'help'; - if ($this->cache->contains($id)) { - return $this->cache->fetch($id); + if ($this->cache->hasItem($id)) { + return $this->cache->getItem($id)->get(); } try { @@ -63,7 +65,9 @@ class OptionsTester implements OptionsTesterInterface throw new RuntimeException('Your FFProbe version is too old and does not support `-help` option, please upgrade.', $e->getCode(), $e); } - $this->cache->save($id, $output); + $cacheItem = $this->cache->getItem($id); + $cacheItem->set($output); + $this->cache->save($cacheItem); return $output; } diff --git a/src/FFMpeg/Filters/Audio/AddMetadataFilter.php b/src/FFMpeg/Filters/Audio/AddMetadataFilter.php index cd0755c..7c466f9 100644 --- a/src/FFMpeg/Filters/Audio/AddMetadataFilter.php +++ b/src/FFMpeg/Filters/Audio/AddMetadataFilter.php @@ -39,10 +39,10 @@ class AddMetadataFilter implements AudioFilterInterface $meta = $this->metaArr; if (is_null($meta)) { - return ['-map_metadata', '-1', '-vn']; + return array('-map_metadata', '-1', '-vn'); } - $metadata = []; + $metadata = array(); if (array_key_exists("artwork", $meta)) { array_push($metadata, "-i", $meta['artwork'], "-map", "0", "-map", "1"); diff --git a/src/FFMpeg/Filters/FiltersCollection.php b/src/FFMpeg/Filters/FiltersCollection.php index 1a1c20a..a0ebbf0 100644 --- a/src/FFMpeg/Filters/FiltersCollection.php +++ b/src/FFMpeg/Filters/FiltersCollection.php @@ -32,6 +32,7 @@ class FiltersCollection implements \Countable, \IteratorAggregate /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function count() { if (0 === count($this->filters)) { @@ -44,6 +45,7 @@ class FiltersCollection implements \Countable, \IteratorAggregate /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function getIterator() { if (null === $this->sorted) { diff --git a/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php b/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php index d2f79bb..65847a7 100644 --- a/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php +++ b/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php @@ -38,7 +38,7 @@ class ExtractMultipleFramesFilter implements VideoFilterInterface private $frameFileType = 'jpg'; /** @var array */ - private static $supportedFrameFileTypes = ['jpg', 'jpeg', 'png']; + private static $supportedFrameFileTypes = array('jpg', 'jpeg', 'png'); public function __construct($frameRate = self::FRAMERATE_EVERY_SEC, $destinationFolder = __DIR__, $priority = 0) { diff --git a/tests/Functional/AudioConcatenationTest.php b/tests/Functional/AudioConcatenationTest.php index cac6232..c5bbc9b 100644 --- a/tests/Functional/AudioConcatenationTest.php +++ b/tests/Functional/AudioConcatenationTest.php @@ -11,10 +11,10 @@ class AudioConcatenationTest extends FunctionalTestCase { $ffmpeg = $this->getFFMpeg(); - $files = [ + $files = array( realpath(__DIR__ . '/../files/Jahzzar_-_05_-_Siesta.mp3'), realpath(__DIR__ . '/../files/02_-_Favorite_Secrets.mp3'), - ]; + ); $audio = $ffmpeg->open(reset($files)); diff --git a/tests/Unit/FFMpegServiceProviderTest.php b/tests/Unit/FFMpegServiceProviderTest.php index a15e679..86476c8 100644 --- a/tests/Unit/FFMpegServiceProviderTest.php +++ b/tests/Unit/FFMpegServiceProviderTest.php @@ -7,6 +7,13 @@ use Silex\Application; class FFMpegServiceProviderTest extends TestCase { + protected function setUp() + { + if (!class_exists('\Application\Silex')) { + $this->markTestSkipped('You MUST have silex/silex installed.'); + } + } + public function testWithConfig() { $app = new Application(); diff --git a/tests/Unit/FFProbe/OptionsTesterTest.php b/tests/Unit/FFProbe/OptionsTesterTest.php index b55386d..619f990 100644 --- a/tests/Unit/FFProbe/OptionsTesterTest.php +++ b/tests/Unit/FFProbe/OptionsTesterTest.php @@ -2,8 +2,9 @@ namespace Tests\FFMpeg\Unit\FFProbe; -use Tests\FFMpeg\Unit\TestCase; use FFMpeg\FFProbe\OptionsTester; +use Symfony\Component\Cache\CacheItem; +use Tests\FFMpeg\Unit\TestCase; class OptionsTesterTest extends TestCase { @@ -36,11 +37,12 @@ class OptionsTesterTest extends TestCase { $cache = $this->getCacheMock(); - $cache->expects($this->never()) - ->method('fetch'); + $cache->expects($this->exactly(2)) + ->method('getItem') + ->will($this->returnValue(new CacheItem)); $cache->expects($this->exactly(2)) - ->method('contains') + ->method('hasItem') ->will($this->returnValue(false)); $cache->expects($this->exactly(2)) @@ -73,16 +75,22 @@ class OptionsTesterTest extends TestCase { $cache = $this->getCacheMock(); - $cache->expects($this->once()) - ->method('fetch') - ->will($this->returnValue($data)); + $cacheItem = new CacheItem; + $cacheItem->set($data); $cache->expects($this->exactly(2)) - ->method('contains') + ->method('getItem') + ->willReturnOnConsecutiveCalls( + $this->returnValue($cacheItem), + $this->returnValue(new CacheItem) + ); + + $cache->expects($this->exactly(2)) + ->method('hasItem') ->willReturnOnConsecutiveCalls( $this->returnValue(false), - $this->returnValue(true)); - + $this->returnValue(true) + ); $cache->expects($this->once()) ->method('save'); @@ -101,14 +109,17 @@ class OptionsTesterTest extends TestCase { $cache = $this->getCacheMock(); - $cache->expects($this->once()) - ->method('fetch') - ->with('option-' . $optionName) - ->will($this->returnValue($isPresent)); + $cacheItem = new CacheItem(); + $cacheItem->set($isPresent); $cache->expects($this->once()) - ->method('contains') - ->with('option-' . $optionName) + ->method('getItem') + ->with(md5('option-' . $optionName)) + ->will($this->returnValue($cacheItem)); + + $cache->expects($this->once()) + ->method('hasItem') + ->with(md5('option-' . $optionName)) ->will($this->returnValue(true)); $ffprobe = $this->getFFProbeDriverMock(); diff --git a/tests/Unit/FFProbeTest.php b/tests/Unit/FFProbeTest.php index d927ab9..57431d5 100644 --- a/tests/Unit/FFProbeTest.php +++ b/tests/Unit/FFProbeTest.php @@ -2,10 +2,11 @@ namespace Tests\FFMpeg\Unit; -use FFMpeg\FFProbe; -use Symfony\Component\Process\ExecutableFinder; -use Alchemy\BinaryDriver\ConfigurationInterface; use Alchemy\BinaryDriver\Configuration; +use Alchemy\BinaryDriver\ConfigurationInterface; +use FFMpeg\FFProbe; +use Symfony\Component\Cache\CacheItem; +use Symfony\Component\Process\ExecutableFinder; class FFProbeTest extends TestCase { @@ -100,13 +101,14 @@ class FFProbeTest extends TestCase $cache = $this->getCacheMock(); $cache->expects($this->once()) - ->method('contains') + ->method('hasItem') ->will($this->returnValue(false)); - $cache->expects($this->never()) - ->method('fetch'); + $cache->expects($this->once()) + ->method('getItem') + ->will($this->returnValue(new CacheItem)); $cache->expects($this->once()) ->method('save') - ->with($this->anything(), $output); + ->with($this->anything()); $driver = $this->getFFProbeDriverMock(); $driver->expects($this->once()) @@ -160,10 +162,11 @@ class FFProbeTest extends TestCase $cache = $this->getCacheMock(); $cache->expects($this->exactly(2)) - ->method('contains') + ->method('hasItem') ->will($this->returnValue(false)); - $cache->expects($this->never()) - ->method('fetch'); + $cache->expects($this->once()) + ->method('getItem') + ->will($this->returnValue(new CacheItem)); $driver = $this->getFFProbeDriverMock(); $driver->expects($this->exactly(2)) @@ -205,13 +208,16 @@ class FFProbeTest extends TestCase $tester = $this->getFFProbeOptionsTesterMock(); + $cacheItem = new CacheItem; + $cacheItem->set($output); + $cache = $this->getCacheMock(); $cache->expects($this->once()) - ->method('contains') + ->method('hasItem') ->will($this->returnValue(true)); $cache->expects($this->once()) - ->method('fetch') - ->will($this->returnValue($output)); + ->method('getItem') + ->will($this->returnValue($cacheItem)); $cache->expects($this->never()) ->method('save'); diff --git a/tests/Unit/Media/VideoTest.php b/tests/Unit/Media/VideoTest.php index 8352c45..39c405d 100644 --- a/tests/Unit/Media/VideoTest.php +++ b/tests/Unit/Media/VideoTest.php @@ -695,12 +695,13 @@ class VideoTest extends AbstractStreamableTestCase ->method('getConfiguration') ->will($this->returnValue($configuration)); + $self = $this; + $driver->expects($this->exactly(1)) ->method('command') ->with($this->isType('array'), false, $this->anything()) - ->will($this->returnCallback(function ($commands, $errors, $listeners) { - var_dump($commands); - $this->assertTrue(!in_array('-b:v', $commands)); + ->will($this->returnCallback(function ($commands, $errors, $listeners) use ($self) { + $self->assertTrue(!in_array('-b:v', $commands)); })); $video = new Video(__FILE__, $driver, $ffprobe); diff --git a/tests/Unit/Media/WaveformTest.php b/tests/Unit/Media/WaveformTest.php index 4151235..dfa9795 100644 --- a/tests/Unit/Media/WaveformTest.php +++ b/tests/Unit/Media/WaveformTest.php @@ -52,7 +52,7 @@ class WaveformTest extends AbstractMediaTestCase ->method('command') ->with($commands); - $waveform = new Waveform($this->getAudioMock(__FILE__), $driver, $ffprobe, 640, 120, ['#FFFFFF']); + $waveform = new Waveform($this->getAudioMock(__FILE__), $driver, $ffprobe, 640, 120, array('#FFFFFF')); $this->assertSame($waveform, $waveform->save($pathfile)); } diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php index 60bd004..2171a78 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -13,7 +13,7 @@ class TestCase extends BaseTestCase public function getCacheMock() { - return $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock(); + return $this->getMockBuilder('Psr\Cache\CacheItemPoolInterface')->getMock(); } public function getTimeCodeMock()