diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-20 12:06:02 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-20 12:06:02 +0100 |
commit | 991ea9cc602d93247d35a1ce94b060f58bcd8205 (patch) | |
tree | 51490b40fb7164abd2e2efa14af9e70c76735d32 /ext/zip | |
parent | a92db42568d5be412fd536cc96475f0a61666223 (diff) | |
download | php-git-991ea9cc602d93247d35a1ce94b060f58bcd8205.tar.gz |
Make zip oo_addpattern test more robust
Use a separate directory for the tests, so that no other tests can
concurrently create files in the same directory.
Diffstat (limited to 'ext/zip')
-rw-r--r-- | ext/zip/tests/oo_addpattern.phpt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/zip/tests/oo_addpattern.phpt b/ext/zip/tests/oo_addpattern.phpt index 73806d5a56..193f828496 100644 --- a/ext/zip/tests/oo_addpattern.phpt +++ b/ext/zip/tests/oo_addpattern.phpt @@ -10,11 +10,13 @@ if(!extension_loaded('zip')) die('skip'); ?> --FILE-- <?php -$dirname = dirname(__FILE__) . '/'; -include $dirname . 'utils.inc'; -$file = $dirname . '__tmp_oo_addpattern.zip'; +include __DIR__ . '/utils.inc'; -copy($dirname . 'test.zip', $file); +$dirname = __DIR__ . '/oo_addpattern_dir/'; +$file = $dirname . 'tmp.zip'; + +@mkdir($dirname); +copy(__DIR__ . '/test.zip', $file); touch($dirname . 'foo.txt'); touch($dirname . 'bar.txt'); @@ -36,10 +38,11 @@ if ($zip->status == ZIPARCHIVE::ER_OK) { ?> --CLEAN-- <?php -$dirname = dirname(__FILE__) . '/'; -unlink($dirname . '__tmp_oo_addpattern.zip'); +$dirname = dirname(__FILE__) . '/oo_addpattern_dir/'; +unlink($dirname . 'tmp.zip'); unlink($dirname . 'foo.txt'); unlink($dirname . 'bar.txt'); +rmdir($dirname); ?> --EXPECT-- 0 bar |