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(__DIR__) or die('cannot open directory: '.__DIR__);
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(__DIR__."/$file");
22        $result[$file] = image_type_to_mime_type($result[$file][2]);
23    }
24    var_dump($result);
25?>
26--EXPECT--
27array(17) {
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.avif"]=>
35  string(10) "image/avif"
36  ["test1pix.bmp"]=>
37  string(9) "image/bmp"
38  ["test1pix.jp2"]=>
39  string(9) "image/jp2"
40  ["test1pix.jpc"]=>
41  string(24) "application/octet-stream"
42  ["test1pix.jpg"]=>
43  string(10) "image/jpeg"
44  ["test2pix.gif"]=>
45  string(9) "image/gif"
46  ["test3llpix.webp"]=>
47  string(10) "image/webp"
48  ["test3pix.webp"]=>
49  string(10) "image/webp"
50  ["test4pix.gif"]=>
51  string(9) "image/gif"
52  ["test4pix.iff"]=>
53  string(9) "image/iff"
54  ["test4pix.png"]=>
55  string(9) "image/png"
56  ["test4pix.psd"]=>
57  string(9) "image/psd"
58  ["test4pix.swf"]=>
59  string(29) "application/x-shockwave-flash"
60  ["test4pix.tiff"]=>
61  string(10) "image/tiff"
62}
63