From 873b86075ce3848072dad4670208fb2ac601c4ea Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 27 Aug 2019 23:10:55 +0100 Subject: [PATCH 1/2] Note that the GD extension is required for generating images --- composer.json | 1 + src/Illuminate/Http/composer.json | 3 +++ tests/Http/HttpTestingFileFactoryTest.php | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/composer.json b/composer.json index 645ac7b28001..c21e544f40a8 100644 --- a/composer.json +++ b/composer.json @@ -114,6 +114,7 @@ } }, "suggest": { + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory\\image::().", "ext-pcntl": "Required to use all features of the queue worker.", "ext-posix": "Required to use all features of the queue worker.", "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (^3.0).", diff --git a/src/Illuminate/Http/composer.json b/src/Illuminate/Http/composer.json index ed8be0bba62e..b2fa5e9fd9c7 100755 --- a/src/Illuminate/Http/composer.json +++ b/src/Illuminate/Http/composer.json @@ -26,6 +26,9 @@ "Illuminate\\Http\\": "" } }, + "suggest": { + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory\\image::()." + }, "extra": { "branch-alias": { "dev-master": "5.8-dev" diff --git a/tests/Http/HttpTestingFileFactoryTest.php b/tests/Http/HttpTestingFileFactoryTest.php index d550dc36cb9e..7af065505562 100644 --- a/tests/Http/HttpTestingFileFactoryTest.php +++ b/tests/Http/HttpTestingFileFactoryTest.php @@ -9,6 +9,10 @@ class HttpTestingFileFactoryTest extends TestCase { public function testImagePng() { + if (! function_exists('imagejpeg')) { + $this->markTestSkipped('The extension gd is missing from your system.'); + } + $image = (new FileFactory)->image('test.png', 15, 20); $info = getimagesize($image->getRealPath()); @@ -20,6 +24,10 @@ public function testImagePng() public function testImageJpeg() { + if (! function_exists('imagejpeg')) { + $this->markTestSkipped('The extension gd is missing from your system.'); + } + $image = (new FileFactory)->image('test.jpeg', 15, 20); $info = getimagesize($image->getRealPath()); From ad9fb0561ae85efd7b6b445f414c793ea245addb Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 27 Aug 2019 23:25:24 +0100 Subject: [PATCH 2/2] Fixed skips --- tests/Http/HttpTestingFileFactoryTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Http/HttpTestingFileFactoryTest.php b/tests/Http/HttpTestingFileFactoryTest.php index 7af065505562..e1ddc009c017 100644 --- a/tests/Http/HttpTestingFileFactoryTest.php +++ b/tests/Http/HttpTestingFileFactoryTest.php @@ -9,8 +9,8 @@ class HttpTestingFileFactoryTest extends TestCase { public function testImagePng() { - if (! function_exists('imagejpeg')) { - $this->markTestSkipped('The extension gd is missing from your system.'); + if (! function_exists('imagepng')) { + $this->markTestSkipped('The extension gd is missing from your system or was compiled without PNG support.'); } $image = (new FileFactory)->image('test.png', 15, 20); @@ -25,7 +25,7 @@ public function testImagePng() public function testImageJpeg() { if (! function_exists('imagejpeg')) { - $this->markTestSkipped('The extension gd is missing from your system.'); + $this->markTestSkipped('The extension gd is missing from your system or was compiled without JPEG support.'); } $image = (new FileFactory)->image('test.jpeg', 15, 20);