1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-24 14:32:52 +02:00

Improve Driver Specializing Process (#1315)

Streamline driver specializing process of analyzers, modifers, encoders and decoders.
This commit is contained in:
Oliver Vogel
2024-03-23 08:08:41 +01:00
committed by GitHub
parent 67be90e570
commit 7f4ff15d51
207 changed files with 1073 additions and 1185 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Modifiers;
use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\Drivers\Gd\Modifiers\TextModifier;
use Intervention\Image\Geometry\Point;
use Intervention\Image\Interfaces\ColorInterface;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use Intervention\Image\Tests\GdTestCase;
use Intervention\Image\Typography\Font;
#[RequiresPhpExtension('gd')]
#[CoversClass(\Intervention\Image\Modifiers\TextModifier::class)]
#[CoversClass(\Intervention\Image\Drivers\Gd\Modifiers\TextModifier::class)]
final class TextModifierTest extends GdTestCase
{
public function testTextColor(): void
{
$font = (new Font())->setColor('ff0055');
$modifier = new class ('test', new Point(), $font) extends TextModifier
{
public function test()
{
return $this->textColor();
}
};
$modifier->setDriver(new Driver());
$this->assertInstanceOf(ColorInterface::class, $modifier->test());
}
}