Skip to content

Commit

Permalink
added gd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gappa committed Nov 30, 2021
1 parent ba13804 commit a1fb58e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tests/ResizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ResizerTest extends TestCase
private Resizer $resizer;
private string $image;
private ResizerConfig $config;
private ?string $thumbnail = null;


public function __construct()
Expand Down Expand Up @@ -75,9 +76,24 @@ public function testImageFound(): void

public function testProcess(): void
{
$thumbnail = FileSystem::normalizePath($this->resizer->process($this->image, 'c200xc200'));

Assert::same(
FileSystem::normalizePath(__DIR__ . '/../temp/resizer/test.png/c200xc200.png'),
$thumbnail,
);
}


public function testGeneratedImage(): void
{
$thumbnail = FileSystem::normalizePath($this->resizer->process($this->image, 'c200xc200'));

$size = getimagesize($thumbnail);

Assert::same(
FileSystem::normalizePath(__DIR__ . '/../temp/resizer/test.png/200x.png'),
FileSystem::normalizePath($this->resizer->process($this->image, '200x')),
[200, 200],
[$size[0], $size[1]],
);
}

Expand Down

0 comments on commit a1fb58e

Please sign in to comment.