Annotation of embedaddon/php/ext/fileinfo/tests/finfo_file_002.phpt, revision 1.1
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--
! 21: array(6) {
! 22: ["%s/resources/dir.zip"]=>
! 23: string(15) "application/zip"
! 24: ["%s/resources/test.bmp"]=>
! 25: string(14) "image/x-ms-bmp"
! 26: ["%s/resources/test.gif"]=>
! 27: string(9) "image/gif"
! 28: ["%s/resources/test.jpg"]=>
! 29: string(10) "image/jpeg"
! 30: ["%s/resources/test.pdf"]=>
! 31: string(15) "application/pdf"
! 32: ["%s/resources/test.png"]=>
! 33: string(9) "image/png"
! 34: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>