From d59cb26d911d89dccb0d48a97fed6a74b6f4ab91 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:06:57 +0100 Subject: [PATCH 1/8] Add github actions --- .github/workflows/test.yaml | 72 +++++++++++++++++++++++++++++++++++++ .travis.yml | 69 ----------------------------------- 2 files changed, 72 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..5c8ce5a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,72 @@ +name: Test + +on: + pull_request: ~ + push: + branches: + - 'master' + schedule: + - cron: "0 0 * * *" + +jobs: + test: + name: "Test ${{ matrix.php-version }}" + runs-on: ubuntu-latest + + env: + PHPUNIT_VERSION: ${{ matrix.phpunit-version }} + + strategy: + fail-fast: false + matrix: + include: + - php-version: '5.3' + phpunit-version: 4 + dependency-versions: 'lowest' + - php-version: '5.4' + phpunit-version: 4 + - php-version: '5.5' + phpunit-version: 4 + - php-version: '5.6' + - php-version: '7.0' + - php-version: '7.1' + - php-version: '7.2' + - php-version: '7.3' + - php-version: '7.4' + - php-version: '8.0' + - php-version: '8.1' + + 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 + + - 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 + if: ${{ matrix.phpunit-version }} + 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; From 0fe457348dbb071b3413032419e446948c544bcb Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:10:34 +0100 Subject: [PATCH 2/8] Update github action --- .github/workflows/test.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5c8ce5a..11ae3e9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,7 +10,7 @@ on: jobs: test: - name: "Test ${{ matrix.php-version }}" + name: "PHP ${{ matrix.php-version }} ${{ matrix.dependency-versions }} ${{ matrix.composer-stability }}" runs-on: ubuntu-latest env: @@ -35,6 +35,9 @@ jobs: - php-version: '7.4' - php-version: '8.0' - php-version: '8.1' + - php-version: '8.1' + dependency-versions: 'highest' + composer-stability: 'dev' steps: - name: Checkout project @@ -53,6 +56,11 @@ jobs: 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 From 1859ab72530b683e1369aa8c37144e0c0a3532f4 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:13:48 +0100 Subject: [PATCH 3/8] Fix php 5.3 compatibility --- src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { From d7df3dae8d5b56d5d31471c33cbe675b305a44cc Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:17:12 +0100 Subject: [PATCH 4/8] Fix php 5.3 compatibility --- tests/Unit/Media/WaveformTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } From c2b99e1ea64f4d458539b40268eaee7b7b61f658 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:20:01 +0100 Subject: [PATCH 5/8] Fix php 5.3 compatibility --- tests/Functional/AudioConcatenationTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); From e7e56d044051ee70f79f16e1bbf42fbf5efb8561 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:23:32 +0100 Subject: [PATCH 6/8] Fix php 5.3 compatibility --- src/FFMpeg/Filters/Audio/AddMetadataFilter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"); From bc50855aa96049aa12394737f4a391a50315ef4f Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 27 Nov 2021 00:28:01 +0100 Subject: [PATCH 7/8] Fix php 5.3 compatibility --- tests/Unit/Media/VideoTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); From 0c13c6dbdf9b9a92855a4e39929655b1e8464153 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 13 Dec 2021 20:35:31 +0100 Subject: [PATCH 8/8] Delete .travis.yml --- .travis.yml | 69 ----------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 .travis.yml 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;