Annotation of embedaddon/php/ext/standard/tests/image/image_type_to_mime_type_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: image_type_to_mime_type()
                      3: --SKIPIF--
                      4: <?php 
                      5:        if (!function_exists('image_type_to_mime_type')) die('skip image_type_to_mime_type() not available');
                      6: ?>
                      7: --FILE--
                      8: <?php
                      9: 
                     10: /* Prototype  : string image_type_to_mime_type  ( int $imagetype  )
                     11:  * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype.
                     12:  * Source code: ext/standard/image.c
                     13:  * Alias to functions: 
                     14:  */
                     15: 
                     16: echo "Starting image_type_to_mime_type() test\n\n";
                     17: 
                     18: $image_types = array (
                     19:        IMAGETYPE_GIF,     
                     20:        IMAGETYPE_JPEG,     
                     21:        IMAGETYPE_PNG,      
                     22:        IMAGETYPE_SWF,      
                     23:        IMAGETYPE_PSD,      
                     24:        IMAGETYPE_BMP,  
                     25:        IMAGETYPE_TIFF_II,  
                     26:        IMAGETYPE_TIFF_MM,  
                     27:        IMAGETYPE_JPC,      
                     28:        IMAGETYPE_JP2,      
                     29:        IMAGETYPE_JPX,      
                     30:        IMAGETYPE_JB2,      
                     31:        IMAGETYPE_IFF,     
                     32:        IMAGETYPE_WBMP, 
                     33:        IMAGETYPE_JPEG2000, 
                     34:        IMAGETYPE_XBM      
                     35: );
                     36: 
                     37:        foreach($image_types as $image_type) {
                     38:                var_dump(image_type_to_mime_type($image_type));
                     39:        }
                     40: 
                     41: echo "\nDone image_type_to_mime_type() test\n";
                     42: ?>
                     43: --EXPECT--
                     44: Starting image_type_to_mime_type() test
                     45: 
                     46: string(9) "image/gif"
                     47: string(10) "image/jpeg"
                     48: string(9) "image/png"
                     49: string(29) "application/x-shockwave-flash"
                     50: string(9) "image/psd"
                     51: string(14) "image/x-ms-bmp"
                     52: string(10) "image/tiff"
                     53: string(10) "image/tiff"
                     54: string(24) "application/octet-stream"
                     55: string(9) "image/jp2"
                     56: string(24) "application/octet-stream"
                     57: string(24) "application/octet-stream"
                     58: string(9) "image/iff"
                     59: string(18) "image/vnd.wap.wbmp"
                     60: string(24) "application/octet-stream"
                     61: string(9) "image/xbm"
                     62: 
                     63: Done image_type_to_mime_type() test

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