-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in ImagickDriver::pixelate, Update tests (#267)
- Loading branch information
Showing
4 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
<?php | ||
|
||
use Spatie\Image\Drivers\ImageDriver; | ||
use Spatie\Image\Exceptions\InvalidManipulation; | ||
|
||
use function Spatie\Snapshots\assertMatchesImageSnapshot; | ||
|
||
it('can pixelate an image', function (ImageDriver $driver) { | ||
it('can pixelate an image', function (ImageDriver $driver, int $pixelate) { | ||
$targetFile = $this->tempDir->path("{$driver->driverName()}/pixelate.png"); | ||
|
||
$driver->loadFile(getTestJpg())->pixelate()->save($targetFile); | ||
$driver->loadFile(getTestJpg())->pixelate($pixelate)->save($targetFile); | ||
|
||
assertMatchesImageSnapshot($targetFile); | ||
})->with('drivers'); | ||
})->with('drivers', [0, 50, 100]); | ||
|
||
it('will throw an exception when passing an invalid pixelate value', function (ImageDriver $driver) { | ||
$driver->loadFile(getTestJpg())->pixelate(101); | ||
})->with('drivers')->throws(InvalidManipulation::class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters