From 2b659a686391286e76893353deca71951085a3d3 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 10 Mar 2024 11:34:59 +0100 Subject: [PATCH] Add test for Font::class stroke functions --- tests/Unit/Typography/FontTest.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/Unit/Typography/FontTest.php b/tests/Unit/Typography/FontTest.php index 93d720fa..06e68b29 100644 --- a/tests/Unit/Typography/FontTest.php +++ b/tests/Unit/Typography/FontTest.php @@ -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); + } }