php-src/ext/gd/tests/imagecreate_error.phpt
Christoph M. Becker a375d54785
Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

22 lines
480 B
PHP

--TEST--
Testing imagecreate(): error on out of bound parameters
--EXTENSIONS--
gd
--SKIPIF--
<?php
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 ($width) must be greater than 0
!! [ValueError] imagecreate(): Argument #2 ($height) must be greater than 0