mirror of
https://github.com/php/php-src.git
synced 2025-01-12 14:04:45 +08:00
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.
This commit is contained in:
parent
a92db42568
commit
991ea9cc60
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user