1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-19 20:21:32 +02:00

Add tests for DrawEllipseModifiers

This commit is contained in:
Oliver Vogel
2022-08-12 17:44:59 +02:00
parent 71e94564a1
commit fe05a1e35d
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace Intervention\Image\Tests\Drivers\Gd\Modifiers;
use Intervention\Image\Drivers\Gd\Modifiers\DrawEllipseModifier;
use Intervention\Image\Geometry\Ellipse;
use Intervention\Image\Geometry\Point;
use Intervention\Image\Tests\TestCase;
use Intervention\Image\Tests\Traits\CanCreateGdTestImage;
/**
* @requires extension gd
* @covers \Intervention\Image\Drivers\Gd\Modifiers\DrawPixelModifier
*/
class DrawEllipseModifierTest extends TestCase
{
use CanCreateGdTestImage;
public function testApply(): void
{
$image = $this->createTestImage('trim.png');
$this->assertEquals('00aef0', $image->pickColor(14, 14)->toHex());
$drawable = new Ellipse(10, 10);
$drawable->background('b53717');
$image->modify(new DrawEllipseModifier(new Point(14, 14), $drawable));
$this->assertEquals('b53717', $image->pickColor(14, 14)->toHex());
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Intervention\Image\Tests\Drivers\Imagick\Modifiers;
use Intervention\Image\Drivers\Imagick\Modifiers\DrawEllipseModifier;
use Intervention\Image\Geometry\Ellipse;
use Intervention\Image\Geometry\Point;
use Intervention\Image\Tests\TestCase;
use Intervention\Image\Tests\Traits\CanCreateImagickTestImage;
class DrawEllipseModifierTest extends TestCase
{
use CanCreateImagickTestImage;
public function testApply(): void
{
$image = $this->createTestImage('trim.png');
$this->assertEquals('00aef0', $image->pickColor(14, 14)->toHex());
$drawable = new Ellipse(10, 10);
$drawable->background('b53717');
$image->modify(new DrawEllipseModifier(new Point(14, 14), $drawable));
$this->assertEquals('b53717', $image->pickColor(14, 14)->toHex());
}
}