1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-01 09:52:59 +02:00

Add bezier curve drawing tool

This commit is contained in:
gammalogic
2024-06-08 12:05:24 +01:00
committed by Oliver Vogel
parent 6d0d0b2002
commit 216f4cffb4
11 changed files with 927 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Geometry\Factories;
use Intervention\Image\Geometry\Factories\BezierFactory;
use Intervention\Image\Geometry\Bezier;
use Intervention\Image\Tests\BaseTestCase;
final class BezierFactoryTest extends BaseTestCase
{
public function testFactoryCallback(): void
{
$factory = new BezierFactory(function ($bezier) {
$bezier->background('f00');
$bezier->border('ff0', 10);
$bezier->point(300, 260);
$bezier->point(150, 335);
$bezier->point(300, 410);
});
$bezier = $factory();
$this->assertInstanceOf(Bezier::class, $bezier);
$this->assertTrue($bezier->hasBackgroundColor());
$this->assertEquals('f00', $bezier->backgroundColor());
$this->assertEquals('ff0', $bezier->borderColor());
$this->assertEquals(10, $bezier->borderSize());
$this->assertEquals(3, $bezier->count());
}
}