mirror of
https://github.com/Intervention/image.git
synced 2025-08-24 22:35:46 +02:00
Add auto encode tests
This commit is contained in:
@@ -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());
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user