From 70c05ba1483d9713cc7bbfb149ecdd4d606bbd2c Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 20 May 2022 11:37:18 +0900 Subject: [PATCH] test: change Config\Images::$libraryPath only when the file exists --- tests/system/Images/ImageMagickHandlerTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/system/Images/ImageMagickHandlerTest.php b/tests/system/Images/ImageMagickHandlerTest.php index 31f1aeadb35b..012e782f6424 100644 --- a/tests/system/Images/ImageMagickHandlerTest.php +++ b/tests/system/Images/ImageMagickHandlerTest.php @@ -47,9 +47,11 @@ protected function setUp(): void $this->path = $this->origin . 'ci-logo.png'; - $handlerConfig = new Images(); - $handlerConfig->libraryPath = '/usr/bin/convert'; - $this->handler = Services::image('imagick', $handlerConfig, false); + $handlerConfig = new Images(); + if (is_file('/usr/bin/convert')) { + $handlerConfig->libraryPath = '/usr/bin/convert'; + } + $this->handler = Services::image('imagick', $handlerConfig, false); } public function testGetVersion()