From ad2e0f396a919ec4e1173c6194485fae75ab7998 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 8 Dec 2023 16:59:23 +0100 Subject: [PATCH] skip --- composer.json | 2 +- .../Actions/PerformManipulationsAction.php | 2 +- src/Support/ImageFactory.php | 2 +- tests/Image/ImageFactoryTest.php | 2 +- tests/Pest.php | 14 +++++++++----- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index ba8e78003..62e95b06c 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "guzzlehttp/guzzle": "^7.4", "league/flysystem-aws-s3-v3": "^3.0", "mockery/mockery": "^1.4", - "nunomaduro/larastan": "^2.0", + "larastan/larastan": "^2.0", "orchestra/testbench": "^7.0|^8.0", "pestphp/pest": "^2.0", "phpstan/extension-installer": "^1.1", diff --git a/src/Conversions/Actions/PerformManipulationsAction.php b/src/Conversions/Actions/PerformManipulationsAction.php index fdad211d9..4c00bf482 100644 --- a/src/Conversions/Actions/PerformManipulationsAction.php +++ b/src/Conversions/Actions/PerformManipulationsAction.php @@ -30,7 +30,7 @@ public function execute( } $image = Image::useImageDriver(config('media-library.image_driver')) - ->load($conversionTempFile) + ->loadFile($conversionTempFile) ->format('jpg'); $conversion->getManipulations()->apply($image); diff --git a/src/Support/ImageFactory.php b/src/Support/ImageFactory.php index 8060abdf6..b943fbaa3 100644 --- a/src/Support/ImageFactory.php +++ b/src/Support/ImageFactory.php @@ -10,6 +10,6 @@ class ImageFactory public static function load(string $path): ImageDriver { return Image::useImageDriver(config('media-library.image_driver')) - ->load($path); + ->loadFile($path); } } diff --git a/tests/Image/ImageFactoryTest.php b/tests/Image/ImageFactoryTest.php index 0e542ffd9..da5eb3568 100644 --- a/tests/Image/ImageFactoryTest.php +++ b/tests/Image/ImageFactoryTest.php @@ -8,5 +8,5 @@ $image = ImageFactory::load($this->getTestJpg()); - expect($image)->toBeInstanceOf(ImagickDriver::class); + expect($image->driverName())->toBe('imagick'); }); diff --git a/tests/Pest.php b/tests/Pest.php index ba2900c47..27dbdd073 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -24,7 +24,7 @@ function assertS3FileNotExists(string $filePath): void function canTestS3(): bool { - return ! empty(getenv('AWS_ACCESS_KEY_ID')); + return !empty(getenv('AWS_ACCESS_KEY_ID')); } function getS3BaseTestDirectory(): string @@ -56,12 +56,16 @@ function unserializeAndSerializeModel($model) return unserialize(serialize($model)); } -function skipWhenRunningOnGitHub(): bool +function skipWhenRunningOnGitHub(): void { - return getenv('GITHUB_ACTIONS') !== false; + if (getenv('GITHUB_ACTIONS') !== false) { + test()->markTestSkipped('This test cannot run on GitHub actions'); + } } -function skipWhenRunningLocally(): bool +function skipWhenRunningLocally(): void { - return getenv('GITHUB_ACTIONS') === false; + if (getenv('GITHUB_ACTIONS') === false) { + test()->markTestSkipped('This test cannot run locally'); + } }