Skip to content

Commit

Permalink
Fix minor corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Oct 26, 2023
1 parent c95c132 commit 68bfa8a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/base/AbstractImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function tearDown(): void
@unlink($this->runtimeWatermarkFile);
}

public function testText()
public function testText(): void
{
if (!$this->isFontTestSupported()) {
$this->markTestSkipped('Skipping ImageGdTest Gd not installed');
Expand All @@ -57,7 +57,7 @@ public function testText()
$this->assertFileExists($this->runtimeTextFile);
}

public function testCrop()
public function testCrop(): void
{
$point = [20, 20];
$img = Image::crop($this->imageFile, 100, 100, $point);
Expand All @@ -66,14 +66,14 @@ public function testCrop()
$this->assertEquals(100, $img->getSize()->getHeight());
}

public function testWatermark()
public function testWatermark(): void
{
$img = Image::watermark($this->imageFile, $this->watermarkFile);
$img->save($this->runtimeWatermarkFile);
$this->assertFileExists($this->runtimeWatermarkFile);
}

public function testFrame()
public function testFrame(): void
{
$frameSize = 5;
$original = Image::getImagine()->open($this->imageFile);
Expand All @@ -84,7 +84,7 @@ public function testFrame()
$this->assertEquals($size->getWidth(), $originalSize->getWidth() + ($frameSize * 2));
}

public function testThumbnail()
public function testThumbnail(): void
{
// THUMBNAIL_OUTBOUND mode.
$img = Image::thumbnail($this->imageFile, 120, 120);
Expand Down Expand Up @@ -122,7 +122,7 @@ public function testThumbnail()
$this->assertEquals(120, $img->getSize()->getHeight());
}

public function testThumbnailWithUpscaleFlag()
public function testThumbnailWithUpscaleFlag(): void
{
// THUMBNAIL_OUTBOUND mode.
$img = Image::thumbnail($this->imageFile, 700, 700, ImageInterface::THUMBNAIL_OUTBOUND | ImageInterface::THUMBNAIL_FLAG_UPSCALE);
Expand Down Expand Up @@ -163,15 +163,15 @@ public function testThumbnailWithUpscaleFlag()
/**
* @dataProvider \yiiunit\imagine\providers\Data::resize
*/
public function testResize($width, $height, $keepAspectRatio, $allowUpscaling, $newWidth, $newHeight)
public function testResize($width, $height, $keepAspectRatio, $allowUpscaling, $newWidth, $newHeight): void
{
$img = Image::resize($this->imageFile, $width, $height, $keepAspectRatio, $allowUpscaling);

$this->assertEquals($newWidth, $img->getSize()->getWidth());
$this->assertEquals($newHeight, $img->getSize()->getHeight());
}

public function testShouldThrowExceptionOnDriverInvalidArgument()
public function testShouldThrowExceptionOnDriverInvalidArgument(): void
{
Image::setImagine(null);
Image::$driver = 'fake-driver';
Expand All @@ -181,10 +181,10 @@ public function testShouldThrowExceptionOnDriverInvalidArgument()
Image::getImagine();
}

public function testIfAutoRotateThrowsException()
public function testIfAutoRotateThrowsException(): void
{
$img = Image::thumbnail($this->imageFile, 120, 120);
$this->assertInstanceOf('\Imagine\Image\ImageInterface', Image::autorotate($img));
$this->assertInstanceOf(ImageInterface::class, Image::autorotate($img));
}

abstract protected function isFontTestSupported();
Expand Down

0 comments on commit 68bfa8a

Please sign in to comment.