Skip to content

Commit

Permalink
Merge branch 'feature/testing-coverage-improvements' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Jan 15, 2024
2 parents 4462e64 + 68a8468 commit 961a934
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Typography/TextBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public function lines(): array
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())) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Colors/Hsl/ChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* @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
{
Expand Down
7 changes: 7 additions & 0 deletions tests/OriginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ public function testMediaType(): void

$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
Expand Down
1 change: 1 addition & 0 deletions tests/Typography/TextBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function testGetLine(): void
$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
Expand Down

0 comments on commit 961a934

Please sign in to comment.