1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-23 22:12:51 +02:00

Add Drawable improvements & preparation for future features

* Add DrawableFactoryInterface
* Add universal Drawable factory class
* Add x/y setter methods to PointInterface
* Replace Point::class type hints by PointInterface::class
This commit is contained in:
Oliver Vogel
2024-06-09 10:49:00 +02:00
committed by GitHub
parent 56a92c7144
commit 410d98002a
18 changed files with 461 additions and 104 deletions

View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Geometry\Factories;
use Intervention\Image\Geometry\Factories\BezierFactory;
use Intervention\Image\Geometry\Factories\CircleFactory;
use Intervention\Image\Geometry\Factories\Drawable;
use Intervention\Image\Geometry\Factories\EllipseFactory;
use Intervention\Image\Geometry\Factories\LineFactory;
use Intervention\Image\Geometry\Factories\PolygonFactory;
use Intervention\Image\Geometry\Factories\RectangleFactory;
use Intervention\Image\Tests\BaseTestCase;
final class DrawableTest extends BaseTestCase
{
public function testBezier(): void
{
$this->assertInstanceOf(BezierFactory::class, Drawable::bezier());
}
public function testCircle(): void
{
$this->assertInstanceOf(CircleFactory::class, Drawable::circle());
}
public function testEllipse(): void
{
$this->assertInstanceOf(EllipseFactory::class, Drawable::ellipse());
}
public function testLine(): void
{
$this->assertInstanceOf(LineFactory::class, Drawable::line());
}
public function testPolygon(): void
{
$this->assertInstanceOf(PolygonFactory::class, Drawable::polygon());
}
public function testRectangle(): void
{
$this->assertInstanceOf(RectangleFactory::class, Drawable::rectangle());
}
}