From b16fd89fab3a37727711d3abc3e89229e3c4f14d Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Wed, 3 Jan 2024 00:13:28 +0100 Subject: [PATCH] Support for PHP 8.3. Dropped support for Laravel 9 (#513) * Support for PHP 8.3. Dropped support for Laravel 9 * Fixed HTTP tests * Update run-tests.yml * Update AddFilterTest.php * Update run-tests.yml * Update run-tests.yml --- .github/workflows/run-tests.yml | 16 +++------------- composer.json | 14 +++++++------- phpunit.xml.dist | 27 +++++---------------------- tests/AddFilterTest.php | 2 +- tests/TileTest.php | 10 +++++----- 5 files changed, 21 insertions(+), 48 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ff23a95..93a1e10 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,15 +11,13 @@ jobs: fail-fast: true matrix: os: [ubuntu-20.04] - php: [8.2, 8.1] - laravel: [10.*, 9.*] + php: [8.3, 8.2, 8.1] + laravel: [10.*] ffmpeg: [5.0, 4.4] dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* name: ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - FF${{ matrix.ffmpeg }} - ${{ matrix.dependency-version }} @@ -53,15 +51,7 @@ jobs: key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-dep-${{ matrix.dependency-version }} - name: Execute tests - run: vendor/bin/phpunit --stop-on-error --stop-on-failure --order-by random - if: matrix.os == 'ubuntu-20.04' + run: vendor/bin/phpunit --order-by random env: FFMPEG_TEMPORARY_FILES_ROOT: ${{ github.workspace }} FFMPEG_TEMPORARY_ENCRYPTED_HLS: /dev/shm - - - name: Execute tests - run: vendor/bin/phpunit --stop-on-error --stop-on-failure --order-by random - if: matrix.os == 'windows-2019' - env: - FFMPEG_TEMPORARY_FILES_ROOT: ${{ github.workspace }} - FFMPEG_TEMPORARY_ENCRYPTED_HLS: ${{ github.workspace }} diff --git a/composer.json b/composer.json index a10a280..4ddd225 100755 --- a/composer.json +++ b/composer.json @@ -20,19 +20,19 @@ } ], "require": { - "php": "^8.1|^8.2", - "illuminate/contracts": "^9.0|^10.0", - "php-ffmpeg/php-ffmpeg": "^1.1", - "ramsey/collection": "^1.0|^2.0" + "php": "^8.1|^8.2|^8.3", + "illuminate/contracts": "^10.0", + "php-ffmpeg/php-ffmpeg": "^1.2", + "ramsey/collection": "^2.0" }, "require-dev": { "league/flysystem-memory": "^3.10", "mockery/mockery": "^1.4.4", "nesbot/carbon": "^2.66", - "orchestra/testbench": "^7.0|^8.0", - "phpunit/phpunit": "^9.5.10", + "orchestra/testbench": "^8.0", + "phpunit/phpunit": "^10.4", "spatie/image": "^2.2", - "spatie/phpunit-snapshot-assertions": "^4.2" + "spatie/phpunit-snapshot-assertions": "^5.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3e341f1..8275be5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,12 @@ + backupGlobals="false" + colors="true" + processIsolation="false" + stopOnFailure="false"> tests - - - src/ - - - - - - - - - - + \ No newline at end of file diff --git a/tests/AddFilterTest.php b/tests/AddFilterTest.php index 5a8f859..eebe892 100644 --- a/tests/AddFilterTest.php +++ b/tests/AddFilterTest.php @@ -15,7 +15,7 @@ use ProtoneMedia\LaravelFFMpeg\Filters\WatermarkFactory; use ProtoneMedia\LaravelFFMpeg\MediaOpener; -class AddFilter extends TestCase +class AddFilterTest extends TestCase { /** @test */ public function it_can_add_a_filter_using_a_closure() diff --git a/tests/TileTest.php b/tests/TileTest.php index be7ed69..7598c8f 100644 --- a/tests/TileTest.php +++ b/tests/TileTest.php @@ -10,6 +10,11 @@ class TileTest extends TestCase { + public static function provideThumbnailAmount() + { + return array_map(fn ($i) => [$i], range(1, 10)); + } + /** @test */ public function it_has_a_tile_filter() { @@ -94,11 +99,6 @@ public function it_can_generate_thumbnails_with_a_specified_quality() ); } - public function provideThumbnailAmount() - { - return array_map(fn ($i) => [$i], range(1, 10)); - } - /** @test */ public function it_has_a_tile_filter_and_can_store_the_vtt_file() {