Skip to content

Commit

Permalink
Added getimagesizefromstring for php 5.3 unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dmongeau committed Feb 4, 2014
1 parent cb3859b commit 233d9dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Folklore\Image\Exception\FormatException;

//Add getimagesizefromstring for PHP 5.3
if (!function_exists('getimagesizefromstring')) {
function getimagesizefromstring($data)
{
$uri = 'data://application/octet-stream;base64,' . base64_encode($data);
return getimagesize($uri);
}
}

class ImageTest extends Orchestra\Testbench\TestCase {

protected $imagePath = '/image.jpg';
Expand Down

0 comments on commit 233d9dd

Please sign in to comment.