1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/gd/tests/imagecreate_error.phpt
Máté Kocsis 50765075db Improve some ValueError messages
Closes GH-5340
2020-04-06 10:41:01 +02:00

22 lines
518 B
PHP

--TEST--
Testing imagecreate(): error on out of bound parameters
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
if (!function_exists("imagecreate")) die("skip GD Version not compatible");
?>
--FILE--
<?php
require __DIR__ . '/func.inc';
trycatch_dump(
fn() => imagecreate(-1, 30),
fn() => imagecreate(30, -1)
);
?>
--EXPECT--
!! [ValueError] imagecreate(): Argument #1 ($x_size) must be greater than 0
!! [ValueError] imagecreate(): Argument #2 ($y_size) must be greater than 0