1--TEST-- 2Fileinfo run upstream tests 3--EXTENSIONS-- 4fileinfo 5--ENV-- 6TZ=UTC 7--FILE-- 8<?php 9 10$lst = glob(__DIR__ . DIRECTORY_SEPARATOR . "upstream/*.testfile"); 11 12foreach($lst as $p) { 13 $mp = dirname($p) . DIRECTORY_SEPARATOR . basename($p, ".testfile") . ".magic"; 14 $tp = dirname($p) . DIRECTORY_SEPARATOR . basename($p, ".testfile") . ".result"; 15 $finfo = finfo_open(FILEINFO_NONE, file_exists($mp) ? $mp : NULL); 16 $i = finfo_file( $finfo, $p); 17 $exp = trim(file_get_contents($tp)); 18 if ($i !== $exp) { 19 echo "'$p' failed\nexp: '$exp'\ngot: '$i'\n"; 20 } 21 finfo_close($finfo); 22} 23 24echo "==DONE=="; 25?> 26--EXPECT-- 27==DONE== 28