com php-src: Make zip oo_addglob test more robust: ext/zip/tests/oo_addglob.phpt
| From: | Nikita Popov | Date: | Thu, 21 Feb 2019 11:19:02 +0000 |
| Subject: | com php-src: Make zip oo_addglob test more robust: ext/zip/tests/oo_addglob.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104801@lists.php.net to get a copy of this message | ||
Commit: 6964ba09052210e8aa7299de4cbc449462cd5da3
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 21 Feb 2019 12:19:02 +0100
Parents: caee56d709f4a49e5b41cdb4849cdea75f860433
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6964ba09052210e8aa7299de4cbc449462cd5da3
Log:
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.
Changed paths:
M ext/zip/tests/oo_addglob.phpt
Diff:
diff --git a/ext/zip/tests/oo_addglob.phpt b/ext/zip/tests/oo_addglob.phpt
index ea21f01..0699797 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