php-src/ext/gd/tests/001.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

28 lines
569 B
PHP

--TEST--
imagecreatefrompng() and empty/missing file
--EXTENSIONS--
gd
--SKIPIF--
<?php if (!function_exists("imagecreatefrompng")) print "skip"; ?>
--FILE--
<?php
$file = __DIR__."/001.test";
@unlink($file);
var_dump(imagecreatefrompng($file));
touch($file);
var_dump(imagecreatefrompng($file));
@unlink($file);
echo "Done\n";
?>
--EXPECTF--
Warning: imagecreatefrompng(%s001.test): Failed to open stream: No such file or directory in %s on line %d
bool(false)
Warning: imagecreatefrompng(): "%s001.test" is not a valid PNG file in %s on line %d
bool(false)
Done