public function testPHP53_getimagesizefromstring() { try { $img = new Image(); $img->loadString('R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); } catch (Exception $e) { isTrue(strpos(PHP_VERSION, '5.3') === 0); } }
/** * @requires PHP 5.4 */ public function testInvalidImageString() { try { $img = new Image(); $img->loadString('__INVALID__', true); } catch (Exception $e) { isTrue($e->getMessage() === 'Invalid image source.'); } try { $img = new Image('__INVALID__', true); } catch (Exception $e) { isTrue($e->getMessage() === 'Invalid image source.'); } }