Return to image_type_to_mime_type_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / image |
1.1 misho 1: --TEST-- 2: Test image_type_to_mime_type() function : error conditions - Pass incorrect number of arguments 3: --FILE-- 4: <?php 5: /* Prototype : proto string image_type_to_mime_type(int imagetype) 6: * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype 7: * Source code: ext/standard/image.c 8: */ 9: 10: $imagetype = IMAGETYPE_GIF; 11: $extra_arg = 10; 12: echo "*** Testing image_type_to_mime_type() : error conditions ***\n"; 13: 14: // Zero arguments 15: echo "\n-- Testing image_type_to_mime_type() function with Zero arguments --\n"; 16: var_dump( image_type_to_mime_type() ); 17: 18: //Test image_type_to_mime_type with one more than the expected number of arguments 19: echo "\n-- Testing image_type_to_mime_type() function with more than expected no. of arguments --\n"; 20: var_dump( image_type_to_mime_type($imagetype, $extra_arg) ); 21: ?> 22: ===DONE=== 23: --EXPECTF-- 24: *** Testing image_type_to_mime_type() : error conditions *** 25: 26: -- Testing image_type_to_mime_type() function with Zero arguments -- 27: 28: Warning: image_type_to_mime_type() expects exactly 1 parameter, 0 given in %simage_type_to_mime_type_error.php on line 13 29: NULL 30: 31: -- Testing image_type_to_mime_type() function with more than expected no. of arguments -- 32: 33: Warning: image_type_to_mime_type() expects exactly 1 parameter, 2 given in %simage_type_to_mime_type_error.php on line 17 34: NULL 35: ===DONE===