1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/fileinfo/tests/finfo_upstream.phpt
Tim Düsterhus 7831f65f83 fileinfo: Stop calling finfo_close() in tests (#18405)
This function is a noop and will be proposed for deprecation. This patch
removes the useless calls.
2025-04-23 18:57:32 +02:00

27 lines
598 B
PHP

--TEST--
Fileinfo run upstream tests
--EXTENSIONS--
fileinfo
--ENV--
TZ=UTC
--FILE--
<?php
$lst = glob(__DIR__ . DIRECTORY_SEPARATOR . "upstream/*.testfile");
foreach($lst as $p) {
$mp = dirname($p) . DIRECTORY_SEPARATOR . basename($p, ".testfile") . ".magic";
$tp = dirname($p) . DIRECTORY_SEPARATOR . basename($p, ".testfile") . ".result";
$finfo = finfo_open(FILEINFO_NONE, file_exists($mp) ? $mp : NULL);
$i = finfo_file( $finfo, $p);
$exp = trim(file_get_contents($tp));
if ($i !== $exp) {
echo "'$p' failed\nexp: '$exp'\ngot: '$i'\n";
}
}
echo "==DONE==";
?>
--EXPECT--
==DONE==