From ab8d54617e2b99a8f0e072d6fbc456158b1db713 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 28 May 2024 17:54:41 +0200 Subject: [PATCH] Pad test --- tests/TestResizing.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/TestResizing.php b/tests/TestResizing.php index 14331ef..6f64a6c 100644 --- a/tests/TestResizing.php +++ b/tests/TestResizing.php @@ -3,6 +3,7 @@ namespace Bkwld\Croppa\Test; use Bkwld\Croppa\Image; +use Intervention\Image\ImageManager; use PHPUnit\Framework\TestCase; /** @@ -94,8 +95,12 @@ public function testWidthAndHeightResize() public function testWidthAndHeightPad() { - $image = new Image($this->src, array_merge($this->options, ['pad' => [0, 0, 0]])); - $size = getimagesizefromstring($image->process(200, 200, ['pad' => [0, 0, 0]])->get()); + $image = new Image($this->src, $this->options); + $imageString = $image->process(200, 200, ['pad' => [100, 100, 100]])->get(); + $size = getimagesizefromstring($imageString); + $firstPixelColor = ImageManager::gd()->read($imageString)->pickColor(1, 1)->toHex(); + + $this->assertEquals('646464', $firstPixelColor); $this->assertEquals('200x200', $size[0].'x'.$size[1]); }