summaryrefslogtreecommitdiff
path: root/ext/gd/tests/imagecreate_error.phpt
blob: 9fd8679c135a46691132d5f104d0ad9cc960ec1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--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] Invalid width (x_size)
!! [ValueError] Invalid height (y_size)