Skip to content

Commit 233d9dd

Browse files
committed
Added getimagesizefromstring for php 5.3 unit testing
1 parent cb3859b commit 233d9dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/ImageTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
44
use Folklore\Image\Exception\FormatException;
55

6+
//Add getimagesizefromstring for PHP 5.3
7+
if (!function_exists('getimagesizefromstring')) {
8+
function getimagesizefromstring($data)
9+
{
10+
$uri = 'data://application/octet-stream;base64,' . base64_encode($data);
11+
return getimagesize($uri);
12+
}
13+
}
14+
615
class ImageTest extends Orchestra\Testbench\TestCase {
716

817
protected $imagePath = '/image.jpg';

0 commit comments

Comments
 (0)