Annotation of embedaddon/php/ext/exif/tests/exif_imagetype_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test exif_imagetype() function : error conditions 
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: /* Prototype  : int exif_imagetype  ( string $filename  )
                      9:  * Description: Determine the type of an image
                     10:  * Source code: ext/exif/exif.c
                     11: */
                     12: 
                     13: echo "*** Testing exif_imagetype() : error conditions ***\n";
                     14: 
                     15: echo "\n-- Testing exif_imagetype() function with no arguments --\n";
                     16: var_dump( exif_imagetype() );
                     17: 
                     18: echo "\n-- Testing exif_imagetype() function with more than expected no. of arguments --\n";
                     19: $extra_arg = 10;
                     20: var_dump( exif_imagetype(dirname(__FILE__).'/test2.jpg', $extra_arg) );
                     21: 
                     22: echo "\n-- Testing exif_imagetype() function with an unknown file  --\n";
                     23: var_dump( exif_imagetype(dirname(__FILE__).'/foo.jpg') );
                     24: 
                     25: 
                     26: ?>
                     27: ===Done===
                     28: --EXPECTF--
                     29: *** Testing exif_imagetype() : error conditions ***
                     30: 
                     31: -- Testing exif_imagetype() function with no arguments --
                     32: 
                     33: Warning: exif_imagetype() expects exactly 1 parameter, 0 given in %s on line %d
                     34: NULL
                     35: 
                     36: -- Testing exif_imagetype() function with more than expected no. of arguments --
                     37: 
                     38: Warning: exif_imagetype() expects exactly 1 parameter, 2 given in %s on line %d
                     39: NULL
                     40: 
                     41: -- Testing exif_imagetype() function with an unknown file  --
                     42: 
                     43: Warning: exif_imagetype(%s/foo.jpg): failed to open stream: No such file or directory in %s on line %d
                     44: bool(false)
                     45: ===Done===
                     46: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>