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