Commit 7831f65f83a for php.net
commit 7831f65f83ac63848c5b63ed4198cdad704a2ed2
Author: Tim Düsterhus <tim@bastelstu.be>
Date: Wed Apr 23 18:57:32 2025 +0200
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.
diff --git a/ext/fileinfo/tests/bug79756.phpt b/ext/fileinfo/tests/bug79756.phpt
index b4ea28baaa9..ad5478b62de 100644
--- a/ext/fileinfo/tests/bug79756.phpt
+++ b/ext/fileinfo/tests/bug79756.phpt
@@ -7,7 +7,6 @@
$filename = __DIR__ . '/bug79756.xls';
$finfo = finfo_open(FILEINFO_MIME);
$mime = finfo_file($finfo, $filename);
-finfo_close($finfo);
echo $mime;
?>
--EXPECT--
diff --git a/ext/fileinfo/tests/cve-2014-1943-mb.phpt b/ext/fileinfo/tests/cve-2014-1943-mb.phpt
index 9dd4a9ec18a..01cf70b811b 100644
--- a/ext/fileinfo/tests/cve-2014-1943-mb.phpt
+++ b/ext/fileinfo/tests/cve-2014-1943-mb.phpt
@@ -15,13 +15,11 @@
file_put_contents($fd, $a);
$fi = finfo_open(FILEINFO_NONE);
var_dump(finfo_file($fi, $fd));
-finfo_close($fi);
file_put_contents($fd, $b);
file_put_contents($fm, $m);
$fi = finfo_open(FILEINFO_NONE, $fm);
var_dump(finfo_file($fi, $fd));
-finfo_close($fi);
?>
Done
--CLEAN--
diff --git a/ext/fileinfo/tests/cve-2014-1943.phpt b/ext/fileinfo/tests/cve-2014-1943.phpt
index 35f66148ae7..1aee196d16f 100644
--- a/ext/fileinfo/tests/cve-2014-1943.phpt
+++ b/ext/fileinfo/tests/cve-2014-1943.phpt
@@ -15,13 +15,11 @@
file_put_contents($fd, $a);
$fi = finfo_open(FILEINFO_NONE);
var_dump(finfo_file($fi, $fd));
-finfo_close($fi);
file_put_contents($fd, $b);
file_put_contents($fm, $m);
$fi = finfo_open(FILEINFO_NONE, $fm);
var_dump(finfo_file($fi, $fd));
-finfo_close($fi);
?>
Done
--CLEAN--
diff --git a/ext/fileinfo/tests/cve-2014-3538-mb.phpt b/ext/fileinfo/tests/cve-2014-3538-mb.phpt
index e6c63e35ac8..3b158a26b72 100644
--- a/ext/fileinfo/tests/cve-2014-3538-mb.phpt
+++ b/ext/fileinfo/tests/cve-2014-3538-mb.phpt
@@ -19,7 +19,6 @@
$t = microtime(true);
var_dump(finfo_file($fi, $fd));
$t = microtime(true) - $t;
-finfo_close($fi);
if ($t < 3) {
echo "Ok\n";
} else {
diff --git a/ext/fileinfo/tests/cve-2014-3538-nojit.phpt b/ext/fileinfo/tests/cve-2014-3538-nojit.phpt
index 2010d538da9..73ecd09561d 100644
--- a/ext/fileinfo/tests/cve-2014-3538-nojit.phpt
+++ b/ext/fileinfo/tests/cve-2014-3538-nojit.phpt
@@ -23,7 +23,6 @@
$t = microtime(true);
var_dump(finfo_file($fi, $fd));
$t = microtime(true) - $t;
-finfo_close($fi);
if ($t < 1.5) {
echo "Ok\n";
} else {
diff --git a/ext/fileinfo/tests/cve-2014-3538.phpt b/ext/fileinfo/tests/cve-2014-3538.phpt
index f15e745fc05..d19278d1dc3 100644
--- a/ext/fileinfo/tests/cve-2014-3538.phpt
+++ b/ext/fileinfo/tests/cve-2014-3538.phpt
@@ -19,7 +19,6 @@
$t = microtime(true);
var_dump(finfo_file($fi, $fd));
$t = microtime(true) - $t;
-finfo_close($fi);
if ($t < 1.5) {
echo "Ok\n";
} else {
diff --git a/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt b/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt
index 7426c909d97..0ed6d48c803 100644
--- a/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt
+++ b/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt
@@ -27,7 +27,6 @@
foreach( $buffers as $string ) {
var_dump( finfo_buffer( $finfo, $string, $option ) );
}
- finfo_close( $finfo );
}
?>
diff --git a/ext/fileinfo/tests/finfo_buffer_basic.phpt b/ext/fileinfo/tests/finfo_buffer_basic.phpt
index e338583fab7..6a6e6a7a862 100644
--- a/ext/fileinfo/tests/finfo_buffer_basic.phpt
+++ b/ext/fileinfo/tests/finfo_buffer_basic.phpt
@@ -27,7 +27,6 @@
foreach( $buffers as $string ) {
var_dump( finfo_buffer( $finfo, $string, $option ) );
}
- finfo_close( $finfo );
}
?>
diff --git a/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt b/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt
index f366972b613..a4d723f86c9 100644
--- a/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt
+++ b/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt
@@ -12,8 +12,6 @@
var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) );
var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) );
-finfo_close( $finfo );
-
// OO way
$finfo = new finfo( FILEINFO_NONE, $magicFile );
var_dump( $finfo->set_flags( FILEINFO_MIME ) );
diff --git a/ext/fileinfo/tests/finfo_set_flags_basic.phpt b/ext/fileinfo/tests/finfo_set_flags_basic.phpt
index 948031a0b80..db71447ae23 100644
--- a/ext/fileinfo/tests/finfo_set_flags_basic.phpt
+++ b/ext/fileinfo/tests/finfo_set_flags_basic.phpt
@@ -12,8 +12,6 @@
var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) );
var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) );
-finfo_close( $finfo );
-
// OO way
$finfo = new finfo( FILEINFO_NONE, $magicFile );
var_dump( $finfo->set_flags( FILEINFO_MIME ) );
diff --git a/ext/fileinfo/tests/finfo_upstream.phpt b/ext/fileinfo/tests/finfo_upstream.phpt
index ef5ec17b037..2a28bd7f776 100644
--- a/ext/fileinfo/tests/finfo_upstream.phpt
+++ b/ext/fileinfo/tests/finfo_upstream.phpt
@@ -18,7 +18,6 @@
if ($i !== $exp) {
echo "'$p' failed\nexp: '$exp'\ngot: '$i'\n";
}
- finfo_close($finfo);
}
echo "==DONE==";