Skip to content

Commit

Permalink
Pad test
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed May 28, 2024
1 parent 069b2a0 commit ab8d546
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/TestResizing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\Image;
use Intervention\Image\ImageManager;
use PHPUnit\Framework\TestCase;

/**
Expand Down Expand Up @@ -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]);
}

Expand Down

0 comments on commit ab8d546

Please sign in to comment.