1--TEST-- 2image_type_to_mime_type() 3--SKIPIF-- 4<?php 5 require_once('skipif_imagetype.inc'); 6?> 7--FILE-- 8<?php 9 // Note: SWC requires zlib 10 $dir = opendir(dirname(__FILE__)) or die('cannot open directory: '.dirname(__FILE__)); 11 $result = array(); 12 $files = array(); 13 while (($file = readdir($dir)) !== FALSE) { 14 if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") { 15 $files[] = $file; 16 } 17 } 18 closedir($dir); 19 sort($files); 20 foreach($files as $file) { 21 $result[$file] = getimagesize(dirname(__FILE__)."/$file"); 22 $result[$file] = image_type_to_mime_type($result[$file][2]); 23 } 24 var_dump($result); 25?> 26--EXPECT-- 27array(16) { 28 ["test-1pix.bmp"]=> 29 string(9) "image/bmp" 30 ["test12pix.webp"]=> 31 string(10) "image/webp" 32 ["test1bpix.bmp"]=> 33 string(9) "image/bmp" 34 ["test1pix.bmp"]=> 35 string(9) "image/bmp" 36 ["test1pix.jp2"]=> 37 string(9) "image/jp2" 38 ["test1pix.jpc"]=> 39 string(24) "application/octet-stream" 40 ["test1pix.jpg"]=> 41 string(10) "image/jpeg" 42 ["test2pix.gif"]=> 43 string(9) "image/gif" 44 ["test3llpix.webp"]=> 45 string(10) "image/webp" 46 ["test3pix.webp"]=> 47 string(10) "image/webp" 48 ["test4pix.gif"]=> 49 string(9) "image/gif" 50 ["test4pix.iff"]=> 51 string(9) "image/iff" 52 ["test4pix.png"]=> 53 string(9) "image/png" 54 ["test4pix.psd"]=> 55 string(9) "image/psd" 56 ["test4pix.swf"]=> 57 string(29) "application/x-shockwave-flash" 58 ["test4pix.tif"]=> 59 string(10) "image/tiff" 60} 61