Annotation of embedaddon/php/ext/fileinfo/tests/finfo_file_002.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: finfo_file(): Testing mime types
3: --SKIPIF--
4: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5: --FILE--
6: <?php
7:
8: $fp = finfo_open(FILEINFO_MIME_TYPE);
9: $results = array();
10:
11: foreach (glob(__DIR__ . "/resources/*") as $filename) {
12: if (is_file($filename)) {
13: $results["$filename"] = finfo_file($fp, $filename);
14: }
15: }
16: ksort($results);
17:
18: var_dump($results);
19: ?>
20: --EXPECTF--
1.1.1.2 ! misho 21: array(8) {
1.1 misho 22: ["%s/resources/dir.zip"]=>
23: string(15) "application/zip"
1.1.1.2 ! misho 24: ["%s/resources/test.awk"]=>
! 25: string(10) "text/plain"
1.1 misho 26: ["%s/resources/test.bmp"]=>
27: string(14) "image/x-ms-bmp"
28: ["%s/resources/test.gif"]=>
29: string(9) "image/gif"
30: ["%s/resources/test.jpg"]=>
31: string(10) "image/jpeg"
1.1.1.2 ! misho 32: ["%s/resources/test.mp3"]=>
! 33: string(10) "audio/mpeg"
1.1 misho 34: ["%s/resources/test.pdf"]=>
35: string(15) "application/pdf"
36: ["%s/resources/test.png"]=>
37: string(9) "image/png"
38: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>