summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-21 12:19:02 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-02-21 12:19:02 +0100
commit6964ba09052210e8aa7299de4cbc449462cd5da3 (patch)
tree696a45556545e2be78e94223cb1ed4afe87f23ca
parentcaee56d709f4a49e5b41cdb4849cdea75f860433 (diff)
downloadphp-git-6964ba09052210e8aa7299de4cbc449462cd5da3.tar.gz
Make zip oo_addglob test more robust
Use a separate directory for the test, so files created in the main test directory cannot influence it.
-rw-r--r--ext/zip/tests/oo_addglob.phpt14
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/zip/tests/oo_addglob.phpt b/ext/zip/tests/oo_addglob.phpt
index ea21f0161a..0699797a5d 100644
--- a/ext/zip/tests/oo_addglob.phpt
+++ b/ext/zip/tests/oo_addglob.phpt
@@ -11,11 +11,12 @@ if(!defined("GLOB_BRACE")) die ('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
-include $dirname . 'utils.inc';
-$file = $dirname . '__tmp_oo_addglob.zip';
+include __DIR__ . '/utils.inc';
+$dirname = __DIR__ . '/oo_addglob_dir/';
+$file = $dirname . 'tmp.zip';
-copy($dirname . 'test.zip', $file);
+@mkdir($dirname);
+copy(__DIR__ . '/test.zip', $file);
touch($dirname . 'foo.txt');
touch($dirname . 'bar.baz');
@@ -36,10 +37,11 @@ if ($zip->status == ZIPARCHIVE::ER_OK) {
?>
--CLEAN--
<?php
-$dirname = dirname(__FILE__) . '/';
-unlink($dirname . '__tmp_oo_addglob.zip');
+$dirname = __DIR__ . '/oo_addglob_dir/';
+unlink($dirname . 'tmp.zip');
unlink($dirname . 'foo.txt');
unlink($dirname . 'bar.baz');
+rmdir($dirname);
?>
--EXPECT--
0 bar