diff --git a/tests/lib/Image/Gmagick.php b/tests/lib/Image/Gmagick.php index 2cb5056d5c133..e826aa3a9d75c 100644 --- a/tests/lib/Image/Gmagick.php +++ b/tests/lib/Image/Gmagick.php @@ -13,6 +13,14 @@ use OCP\Image\Gmagick; class ImageTest extends \Test\TestCase { + protected function setUp(): void { + if (!extension_loaded('gmagick')) { + $this->markTestSkipped('Gmagick module not available. Skipping tests'); + } else { + parent::setUp(); + } + } + public static function tearDownAfterClass(): void { @unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); @unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); diff --git a/tests/lib/Image/Imagick.php b/tests/lib/Image/Imagick.php index 8de9d0c7e30ce..a55dabac52a66 100644 --- a/tests/lib/Image/Imagick.php +++ b/tests/lib/Image/Imagick.php @@ -13,6 +13,14 @@ use OCP\Image\Imagick; class ImageTest extends \Test\TestCase { + protected function setUp(): void { + if (!extension_loaded('imagick')) { + $this->markTestSkipped('Imagick module not available. Skipping tests'); + } else { + parent::setUp(); + } + } + public static function tearDownAfterClass(): void { @unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); @unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); diff --git a/tests/lib/Image/Vips.php b/tests/lib/Image/Vips.php index 21208e960a9ed..01255049b7afd 100644 --- a/tests/lib/Image/Vips.php +++ b/tests/lib/Image/Vips.php @@ -13,6 +13,14 @@ use OCP\Image\Vips; class ImageTest extends \Test\TestCase { + protected function setUp(): void { + if (!extension_loaded('vips')) { + $this->markTestSkipped('Vips module not available. Skipping tests'); + } else { + parent::setUp(); + } + } + public static function tearDownAfterClass(): void { @unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); @unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg');