"Fossies" - the Fresh Open Source Software Archive

Member "php-7.2.27/ext/gd/tests/001.phpt" (22 Jan 2020, 561 Bytes) of package /linux/www/php-7.2.27.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "001.phpt": 7.3.12_vs_7.4.0.

    1 --TEST--
    2 imagecreatefrompng() and empty/missing file
    3 --SKIPIF--
    4 <?php if (!function_exists("imagecreatefrompng")) print "skip"; ?>
    5 --FILE--
    6 <?php
    7 
    8 $file = dirname(__FILE__)."/001.test";
    9 @unlink($file);
   10 
   11 var_dump(imagecreatefrompng($file));
   12 touch($file);
   13 var_dump(imagecreatefrompng($file));
   14 
   15 @unlink($file);
   16 
   17 echo "Done\n";
   18 ?>
   19 --EXPECTF--
   20 Warning: imagecreatefrompng(%s001.test): failed to open stream: No such file or directory in %s on line %d
   21 bool(false)
   22 
   23 Warning: imagecreatefrompng(): '%s001.test' is not a valid PNG file in %s on line %d
   24 bool(false)
   25 Done