From 68bfa8a286bbe6f75deb5ff265dc540883248e38 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Thu, 26 Oct 2023 04:29:32 -0300 Subject: [PATCH] Fix minor corrections. --- tests/base/AbstractImage.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/base/AbstractImage.php b/tests/base/AbstractImage.php index 4d16e51..46d3f9f 100644 --- a/tests/base/AbstractImage.php +++ b/tests/base/AbstractImage.php @@ -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'); @@ -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); @@ -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); @@ -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); @@ -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); @@ -163,7 +163,7 @@ 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); @@ -171,7 +171,7 @@ public function testResize($width, $height, $keepAspectRatio, $allowUpscaling, $ $this->assertEquals($newHeight, $img->getSize()->getHeight()); } - public function testShouldThrowExceptionOnDriverInvalidArgument() + public function testShouldThrowExceptionOnDriverInvalidArgument(): void { Image::setImagine(null); Image::$driver = 'fake-driver'; @@ -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();