mirror of
https://github.com/Intervention/image.git
synced 2025-08-24 14:32:52 +02:00
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Intervention\Image\Tests\Unit\Modifiers;
|
|
|
|
use Intervention\Image\Geometry\Point;
|
|
use Intervention\Image\Interfaces\FontInterface;
|
|
use Intervention\Image\Modifiers\TextModifier;
|
|
use Intervention\Image\Tests\BaseTestCase;
|
|
use Intervention\Image\Typography\Font;
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
|
|
#[CoversClass(TextModifier::class)]
|
|
final class TextModifierTest extends BaseTestCase
|
|
{
|
|
public function testStrokeOffsets(): void
|
|
{
|
|
$modifier = new class ('test', new Point(), new Font()) extends TextModifier
|
|
{
|
|
/**
|
|
* @return array<?Point>
|
|
*/
|
|
public function testStrokeOffsets(FontInterface $font): array
|
|
{
|
|
return $this->strokeOffsets($font);
|
|
}
|
|
};
|
|
|
|
$this->assertEquals([], $modifier->testStrokeOffsets(new Font()));
|
|
|
|
$this->assertEquals([
|
|
new Point(-1, -1),
|
|
new Point(-1, 0),
|
|
new Point(-1, 1),
|
|
new Point(0, -1),
|
|
new Point(0, 0),
|
|
new Point(0, 1),
|
|
new Point(1, -1),
|
|
new Point(1, 0),
|
|
new Point(1, 1),
|
|
], $modifier->testStrokeOffsets((new Font())->setStrokeWidth(1)));
|
|
}
|
|
}
|