Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Coverage Improvements #1265

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading