1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 18:32:56 +02:00

Add test for Font::class stroke functions

This commit is contained in:
Oliver Vogel
2024-03-10 11:34:59 +01:00
parent 0d8df3801e
commit 2b659a6863

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Typography;
use Intervention\Image\Exceptions\FontException;
use Intervention\Image\Tests\BaseTestCase;
use Intervention\Image\Typography\Font;
@@ -81,4 +82,29 @@ final class FontTest extends BaseTestCase
$this->assertInstanceOf(Font::class, $result);
$this->assertEquals(3.2, $font->lineHeight());
}
public function testSetGetStrokeColor(): void
{
$font = new Font();
$this->assertEquals('ffffff', $font->strokeColor());
$result = $font->setStrokeColor('000000');
$this->assertInstanceOf(Font::class, $result);
$this->assertEquals('000000', $font->strokeColor());
}
public function testSetGetStrokeWidth(): void
{
$font = new Font();
$this->assertEquals(0, $font->strokeWidth());
$result = $font->setStrokeWidth(4);
$this->assertInstanceOf(Font::class, $result);
$this->assertEquals(4, $font->strokeWidth());
}
public function testSetStrokeWidthOutOfRange(): void
{
$font = new Font();
$this->expectException(FontException::class);
$font->setStrokeWidth(11);
}
}