diff --git a/tests/Drivers/Gd/DriverTest.php b/tests/Drivers/Gd/DriverTest.php index ab3af1e2..ff6fb3f0 100644 --- a/tests/Drivers/Gd/DriverTest.php +++ b/tests/Drivers/Gd/DriverTest.php @@ -4,7 +4,11 @@ declare(strict_types=1); namespace Intervention\Image\Tests\Drivers\Gd; +use Intervention\Image\Colors\Rgb\Colorspace; +use Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder; use Intervention\Image\Drivers\Gd\Driver; +use Intervention\Image\Interfaces\ColorInterface; +use Intervention\Image\Interfaces\ColorProcessorInterface; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Tests\TestCase; @@ -43,4 +47,38 @@ class DriverTest extends TestCase $this->assertEquals(5, $image->loops()); $this->assertEquals(2, $image->count()); } + + public function testHandleInputImage(): void + { + $result = $this->driver->handleInput($this->getTestImagePath('test.jpg')); + $this->assertInstanceOf(ImageInterface::class, $result); + } + + public function testHandleInputColor(): void + { + $result = $this->driver->handleInput('ffffff'); + $this->assertInstanceOf(ColorInterface::class, $result); + } + + public function testHandleInputObjects(): void + { + $result = $this->driver->handleInput('ffffff', [ + new HexColorDecoder() + ]); + $this->assertInstanceOf(ColorInterface::class, $result); + } + + public function testHandleInputClassnames(): void + { + $result = $this->driver->handleInput('ffffff', [ + HexColorDecoder::class + ]); + $this->assertInstanceOf(ColorInterface::class, $result); + } + + public function testColorProcessor(): void + { + $result = $this->driver->colorProcessor(new Colorspace()); + $this->assertInstanceOf(ColorProcessorInterface::class, $result); + } } diff --git a/tests/Drivers/Imagick/DriverTest.php b/tests/Drivers/Imagick/DriverTest.php index 36b51a40..b497a4f0 100644 --- a/tests/Drivers/Imagick/DriverTest.php +++ b/tests/Drivers/Imagick/DriverTest.php @@ -4,7 +4,11 @@ declare(strict_types=1); namespace Intervention\Image\Tests\Drivers\Imagick; +use Intervention\Image\Colors\Rgb\Colorspace; +use Intervention\Image\Colors\Rgb\Decoders\HexColorDecoder; use Intervention\Image\Drivers\Imagick\Driver; +use Intervention\Image\Interfaces\ColorInterface; +use Intervention\Image\Interfaces\ColorProcessorInterface; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Tests\TestCase; @@ -43,4 +47,38 @@ class DriverTest extends TestCase $this->assertEquals(5, $image->loops()); $this->assertEquals(2, $image->count()); } + + public function testHandleInputImage(): void + { + $result = $this->driver->handleInput($this->getTestImagePath('test.jpg')); + $this->assertInstanceOf(ImageInterface::class, $result); + } + + public function testHandleInputColor(): void + { + $result = $this->driver->handleInput('ffffff'); + $this->assertInstanceOf(ColorInterface::class, $result); + } + + public function testHandleInputObjects(): void + { + $result = $this->driver->handleInput('ffffff', [ + new HexColorDecoder() + ]); + $this->assertInstanceOf(ColorInterface::class, $result); + } + + public function testHandleInputClassnames(): void + { + $result = $this->driver->handleInput('ffffff', [ + HexColorDecoder::class + ]); + $this->assertInstanceOf(ColorInterface::class, $result); + } + + public function testColorProcessor(): void + { + $result = $this->driver->colorProcessor(new Colorspace()); + $this->assertInstanceOf(ColorProcessorInterface::class, $result); + } }