Skip to content

Commit

Permalink
skip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 8, 2023
1 parent b65a3e0 commit ad2e0f3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Conversions/Actions/PerformManipulationsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function execute(
}

$image = Image::useImageDriver(config('media-library.image_driver'))

Check failure on line 32 in src/Conversions/Actions/PerformManipulationsAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Spatie\Image\Drivers\ImageDriver::loadFile().
->load($conversionTempFile)
->loadFile($conversionTempFile)
->format('jpg');

$conversion->getManipulations()->apply($image);
Expand Down
2 changes: 1 addition & 1 deletion src/Support/ImageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion tests/Image/ImageFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

$image = ImageFactory::load($this->getTestJpg());

expect($image)->toBeInstanceOf(ImagickDriver::class);
expect($image->driverName())->toBe('imagick');
});
14 changes: 9 additions & 5 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');
}
}

0 comments on commit ad2e0f3

Please sign in to comment.