Skip to content

Commit a8f6c47

Browse files
committed
Fix exception check in tests
1 parent b640262 commit a8f6c47

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/system/Images/GDHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function testImageCreation()
314314
{
315315
if ($type === 'webp' && ! function_exists('imagecreatefromwebp'))
316316
{
317-
$this->expectException('ImageException');
317+
$this->expectException(ImageException::class);
318318
$this->expectExceptionMessage('Your server does not support the GD function required to process this type of image.');
319319
}
320320

@@ -348,7 +348,7 @@ public function testImageCompressionGetResource()
348348
{
349349
if ($type === 'webp' && ! function_exists('imagecreatefromwebp'))
350350
{
351-
$this->expectException('ImageException');
351+
$this->expectException(ImageException::class);
352352
$this->expectExceptionMessage('Your server does not support the GD function required to process this type of image.');
353353
}
354354

@@ -370,7 +370,7 @@ public function testImageCompressionWithResource()
370370
{
371371
if ($type === 'webp' && ! function_exists('imagecreatefromwebp'))
372372
{
373-
$this->expectException('ImageException');
373+
$this->expectException(ImageException::class);
374374
$this->expectExceptionMessage('Your server does not support the GD function required to process this type of image.');
375375
}
376376

tests/system/Images/ImageMagickHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function testImageCreation()
310310
{
311311
if ($type === 'webp' && ! in_array('WEBP', \Imagick::queryFormats()))
312312
{
313-
$this->expectException('\CodeIgniter\Images\Exceptions\ImageException');
313+
$this->expectException(ImageException::class);
314314
$this->expectExceptionMessage('Your server does not support the GD function required to process this type of image.');
315315
}
316316

@@ -344,7 +344,7 @@ public function testImageCompressionGetResource()
344344
{
345345
if ($type === 'webp' && ! in_array('WEBP', \Imagick::queryFormats()))
346346
{
347-
$this->expectException('\CodeIgniter\Images\Exceptions\ImageException');
347+
$this->expectException(ImageException::class);
348348
$this->expectExceptionMessage('Your server does not support the GD function required to process this type of image.');
349349
}
350350

@@ -366,7 +366,7 @@ public function testImageCompressionWithResource()
366366
{
367367
if ($type === 'webp' && ! in_array('WEBP', \Imagick::queryFormats()))
368368
{
369-
$this->expectException('\CodeIgniter\Images\Exceptions\ImageException');
369+
$this->expectException(ImageException::class);
370370
$this->expectExceptionMessage('Your server does not support the GD function required to process this type of image.');
371371
}
372372

0 commit comments

Comments
 (0)