1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-24 14:32:52 +02:00

Add auto encode tests

This commit is contained in:
Oliver Vogel
2023-12-17 17:03:42 +01:00
parent c594ed1dd0
commit f3e0708bd1
2 changed files with 14 additions and 9 deletions

View File

@@ -4,10 +4,6 @@ namespace Intervention\Image\Tests\Drivers\Gd;
use Intervention\Image\Analyzers\WidthAnalyzer;
use Intervention\Image\Collection;
use Intervention\Image\Colors\Rgb\Channels\Alpha;
use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Drivers\Gd\Core;
use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\Drivers\Gd\Frame;
@@ -119,6 +115,13 @@ class ImageTest extends TestCase
$this->assertInstanceOf(EncodedImage::class, $result);
}
public function testAutoEncode(): void
{
$result = $this->readTestImage('blue.gif')->encode();
$this->assertInstanceOf(EncodedImage::class, $result);
$this->assertMediaType('image/gif', (string) $result);
}
public function testWidthHeightSize(): void
{
$this->assertEquals(3, $this->image->width());

View File

@@ -3,11 +3,6 @@
namespace Intervention\Image\Tests\Drivers\Imagick;
use Imagick;
use ImagickPixel;
use Intervention\Image\Colors\Rgb\Channels\Alpha;
use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Analyzers\WidthAnalyzer;
use Intervention\Image\Collection;
use Intervention\Image\Drivers\Imagick\Core;
@@ -119,6 +114,13 @@ class ImageTest extends TestCase
$this->assertInstanceOf(EncodedImage::class, $result);
}
public function testAutoEncode(): void
{
$result = $this->readTestImage('blue.gif')->encode();
$this->assertInstanceOf(EncodedImage::class, $result);
$this->assertMediaType('image/gif', (string) $result);
}
public function testWidthHeightSize(): void
{
$this->assertEquals(20, $this->image->width());