Skip to content

Commit 0c83091

Browse files
GrahamCampbelltaylorotwell
authored andcommitted
[5.8] Note that the GD extension is required for generating images (#29770)
* Note that the GD extension is required for generating images * Fixed skips
1 parent fd124d7 commit 0c83091

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
}
115115
},
116116
"suggest": {
117+
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory\\image::().",
117118
"ext-pcntl": "Required to use all features of the queue worker.",
118119
"ext-posix": "Required to use all features of the queue worker.",
119120
"aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (^3.0).",

src/Illuminate/Http/composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"Illuminate\\Http\\": ""
2727
}
2828
},
29+
"suggest": {
30+
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory\\image::()."
31+
},
2932
"extra": {
3033
"branch-alias": {
3134
"dev-master": "5.8-dev"

tests/Http/HttpTestingFileFactoryTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ class HttpTestingFileFactoryTest extends TestCase
99
{
1010
public function testImagePng()
1111
{
12+
if (! function_exists('imagepng')) {
13+
$this->markTestSkipped('The extension gd is missing from your system or was compiled without PNG support.');
14+
}
15+
1216
$image = (new FileFactory)->image('test.png', 15, 20);
1317

1418
$info = getimagesize($image->getRealPath());
@@ -20,6 +24,10 @@ public function testImagePng()
2024

2125
public function testImageJpeg()
2226
{
27+
if (! function_exists('imagejpeg')) {
28+
$this->markTestSkipped('The extension gd is missing from your system or was compiled without JPEG support.');
29+
}
30+
2331
$image = (new FileFactory)->image('test.jpeg', 15, 20);
2432

2533
$info = getimagesize($image->getRealPath());

0 commit comments

Comments
 (0)