diff --git a/src/Typography/TextBlock.php b/src/Typography/TextBlock.php index f83a7dc4..2eea0f13 100644 --- a/src/Typography/TextBlock.php +++ b/src/Typography/TextBlock.php @@ -23,6 +23,12 @@ class TextBlock extends Collection return $this->items; } + /** + * Get line by given key + * + * @param mixed $key + * @return null|Line + */ public function line($key): ?Line { if (!array_key_exists($key, $this->lines())) { diff --git a/tests/Colors/Hsl/ChannelTest.php b/tests/Colors/Hsl/ChannelTest.php index 2c7f9c27..0b540efb 100644 --- a/tests/Colors/Hsl/ChannelTest.php +++ b/tests/Colors/Hsl/ChannelTest.php @@ -11,7 +11,7 @@ use Intervention\Image\Tests\TestCase; /** * @covers \Intervention\Image\Colors\Hsl\Channels\Hue * @covers \Intervention\Image\Colors\Hsl\Channels\Saturation - * @covers \Intervention\Image\Colors\Hsl\Channels\Value + * @covers \Intervention\Image\Colors\Hsl\Channels\Luminance */ class ChannelTest extends TestCase { diff --git a/tests/OriginTest.php b/tests/OriginTest.php index 9d9b2cdc..c3374ab9 100644 --- a/tests/OriginTest.php +++ b/tests/OriginTest.php @@ -13,6 +13,13 @@ class OriginTest extends TestCase $origin = new Origin('image/gif'); $this->assertEquals('image/gif', $origin->mediaType()); + $this->assertEquals('image/gif', $origin->mimetype()); + } + + public function testFilePath(): void + { + $origin = new Origin('image/jpeg', __DIR__ . '/tests/images/example.jpg'); + $this->assertEquals(__DIR__ . '/tests/images/example.jpg', $origin->filePath()); } public function testFileExtension(): void diff --git a/tests/Typography/TextBlockTest.php b/tests/Typography/TextBlockTest.php index 60f7cf35..4f8cad43 100644 --- a/tests/Typography/TextBlockTest.php +++ b/tests/Typography/TextBlockTest.php @@ -35,6 +35,7 @@ class TextBlockTest extends TestCase $this->assertEquals('foo', $block->line(0)); $this->assertEquals('FooBar', $block->line(1)); $this->assertEquals('bar', $block->line(2)); + $this->assertNull($block->line(20)); } public function testLongestLine(): void