Skip to content

Commit

Permalink
Update tests in the OptimizeTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
golubev committed Jul 18, 2023
1 parent 327f999 commit dec9f31
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions tests/Manipulations/OptimizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@
it('can optimize an image with the given optimization options', function () {
$targetFile = $this->tempDir->path('optimized.jpg');

Image::load(getTestFile('test.jpg'))
->optimize([
'optimizers' => [
Jpegoptim::class => [
'--all-progressive',
],
],
])
->save($targetFile);

expect($targetFile)->toBeFile();
});

it('can optimize an image with options format backward compatibility', function () {
$targetFile = $this->tempDir->path('optimized.jpg');

Image::load(getTestFile('test.jpg'))
->optimize([Jpegoptim::class => [
'--all-progressive',
Expand All @@ -46,12 +62,14 @@
Image::load(getTestFile('test.jpg'))
->setOptimizeChain(OptimizerChainFactory::create())
->optimize([
Pngquant::class => [
'--force',
],
Jpegoptim::class => [
'--all-progressive',
],
'optimizers' => [
Pngquant::class => [
'--force',
],
Jpegoptim::class => [
'--all-progressive',
],
]
])
->save($targetFile);

Expand Down

0 comments on commit dec9f31

Please sign in to comment.