Skip to content

Commit

Permalink
[5.4] Fix issue in php5.6 when generate fake images for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
morrizon committed Mar 15, 2017
1 parent 40dbf32 commit 79c288f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Http/Testing/FileFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public function image($name, $width = 10, $height = 10)
protected function generateImage($width, $height)
{
return tap(tmpfile(), function ($temp) use ($width, $height) {
imagepng(imagecreatetruecolor($width, $height), $temp);
ob_start();
imagepng(imagecreatetruecolor($width, $height));
fwrite($temp, ob_get_clean());
});
}
}

0 comments on commit 79c288f

Please sign in to comment.