summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-07 16:15:44 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-07 16:15:44 +0200
commit2a334f165541e6f1efa5a9c7e927e689f4c47f3f (patch)
treeaf154d97f1eebf0d4c5516f0d428cc31f7c683ad
parent4ebc04ca9d0a8871dc511f48977c36a4c9782ee0 (diff)
downloadphp-git-2a334f165541e6f1efa5a9c7e927e689f4c47f3f.tar.gz
Don't leave behind temporary file in bug70362.phpt
-rw-r--r--ext/standard/tests/streams/bug70362.phpt11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/standard/tests/streams/bug70362.phpt b/ext/standard/tests/streams/bug70362.phpt
index 3fbc3fea16..fa05ecdef5 100644
--- a/ext/standard/tests/streams/bug70362.phpt
+++ b/ext/standard/tests/streams/bug70362.phpt
@@ -4,11 +4,16 @@ Bug #70362 (Can't copy() large 'data://' with open_basedir)
open_basedir=.
--FILE--
<?php
-$temp = tempnam(__DIR__, 'test');
+$file = __DIR__ . '/bug70362.txt';
$data = str_repeat('0', 4096);
$data = 'data://plain/text;base64,' . base64_encode($data);
-var_dump(copy($data, $temp));
-echo file_get_contents($temp);
+var_dump(copy($data, $file));
+echo file_get_contents($file);
+?>
+--CLEAN--
+<?php
+$file = __DIR__ . '/bug70362.txt';
+@unlink($file);
?>
--EXPECT--
bool(true)