summaryrefslogtreecommitdiff
path: root/ext/zip/tests
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2019-03-15 23:36:47 +0100
committerPeter Kokot <peterkokot@gmail.com>2019-03-15 23:36:47 +0100
commit6426420f61de0df32a6085924d25b347c8788363 (patch)
treeef32814ffbea0ad3c3c38a942f9751302606c736 /ext/zip/tests
parentf26c8644bb340e9e7abb6d1cedb091e9d87dd1d4 (diff)
parent26dfce7f36d1c6f737ac241df1315a1b42b932c7 (diff)
downloadphp-git-6426420f61de0df32a6085924d25b347c8788363.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Replace dirname(__FILE__) by __DIR__ in tests
Diffstat (limited to 'ext/zip/tests')
-rw-r--r--ext/zip/tests/bug14962.phpt2
-rw-r--r--ext/zip/tests/bug38944.phpt2
-rw-r--r--ext/zip/tests/bug40228-mb.phpt2
-rw-r--r--ext/zip/tests/bug40228.phpt2
-rw-r--r--ext/zip/tests/bug47667.phpt2
-rw-r--r--ext/zip/tests/bug49072.phpt2
-rw-r--r--ext/zip/tests/bug51353.phpt4
-rw-r--r--ext/zip/tests/bug53579.phpt4
-rw-r--r--ext/zip/tests/bug53603.phpt2
-rw-r--r--ext/zip/tests/bug53885.phpt4
-rw-r--r--ext/zip/tests/bug64342_0.phpt4
-rw-r--r--ext/zip/tests/bug64342_1-mb.phpt2
-rw-r--r--ext/zip/tests/bug64342_1.phpt2
-rw-r--r--ext/zip/tests/bug70350.phpt4
-rw-r--r--ext/zip/tests/bug7214.phpt2
-rw-r--r--ext/zip/tests/bug72258.phpt2
-rw-r--r--ext/zip/tests/bug72660.phpt4
-rw-r--r--ext/zip/tests/bug7658.phpt2
-rw-r--r--ext/zip/tests/bug8009.phpt2
-rw-r--r--ext/zip/tests/bug8700.phpt2
-rw-r--r--ext/zip/tests/doubleclose.phpt4
-rw-r--r--ext/zip/tests/oo_addemptydir.phpt2
-rw-r--r--ext/zip/tests/oo_addfile.phpt2
-rw-r--r--ext/zip/tests/oo_addpattern.phpt2
-rw-r--r--ext/zip/tests/oo_close.phpt2
-rw-r--r--ext/zip/tests/oo_count.phpt2
-rw-r--r--ext/zip/tests/oo_delete.phpt2
-rw-r--r--ext/zip/tests/oo_extract.phpt2
-rw-r--r--ext/zip/tests/oo_getcomment.phpt2
-rw-r--r--ext/zip/tests/oo_getnameindex.phpt2
-rw-r--r--ext/zip/tests/oo_getstatusstring.phpt2
-rw-r--r--ext/zip/tests/oo_namelocate.phpt2
-rw-r--r--ext/zip/tests/oo_open.phpt2
-rw-r--r--ext/zip/tests/oo_properties.phpt2
-rw-r--r--ext/zip/tests/oo_rename.phpt2
-rw-r--r--ext/zip/tests/oo_setcomment.phpt2
-rw-r--r--ext/zip/tests/oo_setcompression.phpt4
-rw-r--r--ext/zip/tests/oo_stream.phpt4
-rw-r--r--ext/zip/tests/oo_unchangeIndex.phpt2
-rw-r--r--ext/zip/tests/oo_unchangeName.phpt2
-rw-r--r--ext/zip/tests/pecl12414.phpt2
-rw-r--r--ext/zip/tests/stream_meta_data.phpt4
-rw-r--r--ext/zip/tests/zip_close.phpt2
-rw-r--r--ext/zip/tests/zip_entry_close.phpt2
-rw-r--r--ext/zip/tests/zip_entry_compressedsize.phpt2
-rw-r--r--ext/zip/tests/zip_entry_compressionmethod.phpt2
-rw-r--r--ext/zip/tests/zip_entry_filesize.phpt2
-rw-r--r--ext/zip/tests/zip_entry_name.phpt2
-rw-r--r--ext/zip/tests/zip_entry_open.phpt2
-rw-r--r--ext/zip/tests/zip_entry_read.phpt2
-rw-r--r--ext/zip/tests/zip_open.phpt2
-rw-r--r--ext/zip/tests/zip_read.phpt2
52 files changed, 62 insertions, 62 deletions
diff --git a/ext/zip/tests/bug14962.phpt b/ext/zip/tests/bug14962.phpt
index 63a63b6eb9..06a2ce5e6a 100644
--- a/ext/zip/tests/bug14962.phpt
+++ b/ext/zip/tests/bug14962.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dir = dirname(__FILE__);
+$dir = __DIR__;
$file = '__tmp14962.txt';
$fullpath = $dir . '/' . $file;
$za = new ZipArchive;
diff --git a/ext/zip/tests/bug38944.phpt b/ext/zip/tests/bug38944.phpt
index b4ff2b2f19..d016fa6268 100644
--- a/ext/zip/tests/bug38944.phpt
+++ b/ext/zip/tests/bug38944.phpt
@@ -5,7 +5,7 @@ Bug #38944 (newly created ZipArchive segfaults when accessing comment property)
--FILE--
<?php
-$arc_name = dirname(__FILE__)."/bug38944.zip";
+$arc_name = __DIR__."/bug38944.zip";
$foo = new ZipArchive;
$foo->open($arc_name, ZIPARCHIVE::CREATE);
diff --git a/ext/zip/tests/bug40228-mb.phpt b/ext/zip/tests/bug40228-mb.phpt
index db9e2e90d5..b7095dda68 100644
--- a/ext/zip/tests/bug40228-mb.phpt
+++ b/ext/zip/tests/bug40228-mb.phpt
@@ -4,7 +4,7 @@ Bug #40228 (extractTo does not create recursive empty path)
<?php if (!extension_loaded("zip")) print "skip"; ?>
--FILE--
<?php
-$dest = dirname(__FILE__);
+$dest = __DIR__;
$arc_name = $dest . "/bug40228私はガラスを食べられます.zip";
$zip = new ZipArchive;
$zip->open($arc_name, ZIPARCHIVE::CREATE);
diff --git a/ext/zip/tests/bug40228.phpt b/ext/zip/tests/bug40228.phpt
index 2691b3b22f..ce5f1e6afe 100644
--- a/ext/zip/tests/bug40228.phpt
+++ b/ext/zip/tests/bug40228.phpt
@@ -4,7 +4,7 @@ Bug #40228 (extractTo does not create recursive empty path)
<?php if (!extension_loaded("zip")) print "skip"; ?>
--FILE--
<?php
-$dest = dirname(__FILE__);
+$dest = __DIR__;
$arc_name = $dest . "/bug40228.zip";
$zip = new ZipArchive;
$zip->open($arc_name, ZIPARCHIVE::CREATE);
diff --git a/ext/zip/tests/bug47667.phpt b/ext/zip/tests/bug47667.phpt
index e52f7470a8..085fb1b87f 100644
--- a/ext/zip/tests/bug47667.phpt
+++ b/ext/zip/tests/bug47667.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$thisdir = dirname(__FILE__);
+$thisdir = __DIR__;
$filename = $thisdir . "/bug47667.zip";
$zip = new ZipArchive();
diff --git a/ext/zip/tests/bug49072.phpt b/ext/zip/tests/bug49072.phpt
index 731f015fc5..b918fba01b 100644
--- a/ext/zip/tests/bug49072.phpt
+++ b/ext/zip/tests/bug49072.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$f = dirname(__FILE__) . '/bug49072.zip';
+$f = __DIR__ . '/bug49072.zip';
$o = new ZipArchive();
if (! $o->open($f, ZipArchive::CHECKCONS)) {
exit ('error can\'t open');
diff --git a/ext/zip/tests/bug51353.phpt b/ext/zip/tests/bug51353.phpt
index 560945f9dd..d84de38f5b 100644
--- a/ext/zip/tests/bug51353.phpt
+++ b/ext/zip/tests/bug51353.phpt
@@ -10,7 +10,7 @@ die('skip the test might get very long, activate it manually');
adding an explicit skip, remove it to run this test. */
set_time_limit(0);
-$base_path = dirname(__FILE__);
+$base_path = __DIR__;
/* Either we ship a file with 100000 entries which would be >12M big,
or create it dynamically. */
@@ -40,7 +40,7 @@ if ($r) {
echo "OK";
--CLEAN--
<?php
-$base_path = dirname(__FILE__);
+$base_path = __DIR__;
unlink("$base_path/51353.zip");
diff --git a/ext/zip/tests/bug53579.phpt b/ext/zip/tests/bug53579.phpt
index fb7553041d..371dc31e4f 100644
--- a/ext/zip/tests/bug53579.phpt
+++ b/ext/zip/tests/bug53579.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
include $dirname . 'utils.inc';
$zip = new ZipArchive;
@@ -24,7 +24,7 @@ $zip->close();
var_dump($contents);
-$fp = fopen('zip://' . dirname(__FILE__) . '/test_with_comment.zip#foo', 'rb');
+$fp = fopen('zip://' . __DIR__ . '/test_with_comment.zip#foo', 'rb');
if (!$fp) {
exit("cannot open\n");
}
diff --git a/ext/zip/tests/bug53603.phpt b/ext/zip/tests/bug53603.phpt
index 56d84ad3de..0a501071e5 100644
--- a/ext/zip/tests/bug53603.phpt
+++ b/ext/zip/tests/bug53603.phpt
@@ -17,7 +17,7 @@ class TestStream {
stream_wrapper_register("teststream", "TestStream");
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
$zip = new ZipArchive;
if ($zip->open($file) !== TRUE) {
diff --git a/ext/zip/tests/bug53885.phpt b/ext/zip/tests/bug53885.phpt
index 5db2367c30..6f95a661b3 100644
--- a/ext/zip/tests/bug53885.phpt
+++ b/ext/zip/tests/bug53885.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$fname = dirname(__FILE__)."/test53885.zip";
+$fname = __DIR__."/test53885.zip";
if(file_exists($fname)) unlink($fname);
touch($fname);
$nx=new ZipArchive();
@@ -17,7 +17,7 @@ $nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);
==DONE==
--CLEAN--
<?php
-$fname = dirname(__FILE__)."/test53885.zip";
+$fname = __DIR__."/test53885.zip";
unlink($fname);
?>
--EXPECT--
diff --git a/ext/zip/tests/bug64342_0.phpt b/ext/zip/tests/bug64342_0.phpt
index ea7afa8e0a..96e9667dda 100644
--- a/ext/zip/tests/bug64342_0.phpt
+++ b/ext/zip/tests/bug64342_0.phpt
@@ -8,7 +8,7 @@ Bug #64342 ZipArchive::addFile() has to check file existence (variation 1)
<?php
$zip = new ZipArchive;
-$res = $zip->open(dirname(__FILE__) . '/bug64342.zip', ZipArchive::CREATE);
+$res = $zip->open(__DIR__ . '/bug64342.zip', ZipArchive::CREATE);
if ($res === TRUE) {
$f = md5(uniqid()) . '.txt';
echo "$f\n";
@@ -34,7 +34,7 @@ DONE
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . '/bug64342.zip');
+@unlink(__DIR__ . '/bug64342.zip');
--EXPECTF--
%s.txt
add failed
diff --git a/ext/zip/tests/bug64342_1-mb.phpt b/ext/zip/tests/bug64342_1-mb.phpt
index a4525f0cc8..611a416253 100644
--- a/ext/zip/tests/bug64342_1-mb.phpt
+++ b/ext/zip/tests/bug64342_1-mb.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__私はガラスを食べられますtmp_oo_addfile.zip';
diff --git a/ext/zip/tests/bug64342_1.phpt b/ext/zip/tests/bug64342_1.phpt
index d1d0f49931..84cd5db993 100644
--- a/ext/zip/tests/bug64342_1.phpt
+++ b/ext/zip/tests/bug64342_1.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_addfile.zip';
diff --git a/ext/zip/tests/bug70350.phpt b/ext/zip/tests/bug70350.phpt
index d81de65a32..9308f39187 100644
--- a/ext/zip/tests/bug70350.phpt
+++ b/ext/zip/tests/bug70350.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dir = dirname(__FILE__)."/bug70350";
+$dir = __DIR__."/bug70350";
mkdir($dir);
$archive = new ZipArchive();
$archive->open("$dir/a.zip",ZipArchive::CREATE);
@@ -23,7 +23,7 @@ var_dump(file_exists("../down2/"));
?>
--CLEAN--
<?php
-$dir = dirname(__FILE__)."/bug70350";
+$dir = __DIR__."/bug70350";
rmdir("$dir/down2");
unlink("$dir/a.zip");
rmdir($dir);
diff --git a/ext/zip/tests/bug7214.phpt b/ext/zip/tests/bug7214.phpt
index 02455fa421..d36f0f4b42 100644
--- a/ext/zip/tests/bug7214.phpt
+++ b/ext/zip/tests/bug7214.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/binarynull.zip");
+$zip = zip_open(__DIR__."/binarynull.zip");
if (!is_resource($zip)) die("Failure");
$entries = 0;
$entry = zip_read($zip);
diff --git a/ext/zip/tests/bug72258.phpt b/ext/zip/tests/bug72258.phpt
index 6ab5c5ee7e..208a810c33 100644
--- a/ext/zip/tests/bug72258.phpt
+++ b/ext/zip/tests/bug72258.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug72258.zip";
+$fn = __DIR__ . DIRECTORY_SEPARATOR . "bug72258.zip";
$zip = new \ZipArchive();
$res = $zip->open($fn);
diff --git a/ext/zip/tests/bug72660.phpt b/ext/zip/tests/bug72660.phpt
index af02b9b5a3..188c7b37e6 100644
--- a/ext/zip/tests/bug72660.phpt
+++ b/ext/zip/tests/bug72660.phpt
@@ -8,13 +8,13 @@ if(PHP_ZTS == 0) { die('skip ZTS required'); }
--FILE--
<?php
$zip = new ZipArchive();
-$zip->open(dirname(__FILE__) . "/bug72660.zip", ZIPARCHIVE::CREATE);
+$zip->open(__DIR__ . "/bug72660.zip", ZIPARCHIVE::CREATE);
$zip->addPattern("/noexists/");
?>
okey
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . "/bug72660.zip");
+@unlink(__DIR__ . "/bug72660.zip");
?>
--EXPECT--
okey
diff --git a/ext/zip/tests/bug7658.phpt b/ext/zip/tests/bug7658.phpt
index a09848a679..9253b01c3f 100644
--- a/ext/zip/tests/bug7658.phpt
+++ b/ext/zip/tests/bug7658.phpt
@@ -23,7 +23,7 @@ $expect = array(
"settings.xml",
"META-INF/manifest.xml",
);
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_bug7658.odt';
$zip = new ZipArchive();
diff --git a/ext/zip/tests/bug8009.phpt b/ext/zip/tests/bug8009.phpt
index 61aaca77bd..4cc85a1b3f 100644
--- a/ext/zip/tests/bug8009.phpt
+++ b/ext/zip/tests/bug8009.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$thisdir = dirname(__FILE__);
+$thisdir = __DIR__;
$src = $thisdir . "/bug8009.zip";
$filename = $thisdir . "/tmp8009.zip";
copy($src, $filename);
diff --git a/ext/zip/tests/bug8700.phpt b/ext/zip/tests/bug8700.phpt
index 5a25af3a11..67bd265f9a 100644
--- a/ext/zip/tests/bug8700.phpt
+++ b/ext/zip/tests/bug8700.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$thisdir = dirname(__FILE__);
+$thisdir = __DIR__;
$filename = $thisdir . "/bug8009.zip";
$zip = new ZipArchive();
diff --git a/ext/zip/tests/doubleclose.phpt b/ext/zip/tests/doubleclose.phpt
index 0eccc40bad..48547e3c72 100644
--- a/ext/zip/tests/doubleclose.phpt
+++ b/ext/zip/tests/doubleclose.phpt
@@ -8,7 +8,7 @@ if(!extension_loaded('zip')) die('skip');
<?php
echo "Procedural\n";
-$zip = zip_open(dirname(__FILE__) . '/test.zip');
+$zip = zip_open(__DIR__ . '/test.zip');
if (!is_resource($zip)) {
die("Failure");
}
@@ -17,7 +17,7 @@ var_dump(zip_close($zip));
echo "Object\n";
$zip = new ZipArchive();
-if (!$zip->open(dirname(__FILE__) . '/test.zip')) {
+if (!$zip->open(__DIR__ . '/test.zip')) {
die('Failure');
}
if ($zip->status == ZIPARCHIVE::ER_OK) {
diff --git a/ext/zip/tests/oo_addemptydir.phpt b/ext/zip/tests/oo_addemptydir.phpt
index 271410b938..e63952935d 100644
--- a/ext/zip/tests/oo_addemptydir.phpt
+++ b/ext/zip/tests/oo_addemptydir.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_addfile.zip';
diff --git a/ext/zip/tests/oo_addfile.phpt b/ext/zip/tests/oo_addfile.phpt
index b41e3dbf2c..7592f5b2b4 100644
--- a/ext/zip/tests/oo_addfile.phpt
+++ b/ext/zip/tests/oo_addfile.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_addfile.zip';
diff --git a/ext/zip/tests/oo_addpattern.phpt b/ext/zip/tests/oo_addpattern.phpt
index 193f828496..a66ecba312 100644
--- a/ext/zip/tests/oo_addpattern.phpt
+++ b/ext/zip/tests/oo_addpattern.phpt
@@ -38,7 +38,7 @@ if ($zip->status == ZIPARCHIVE::ER_OK) {
?>
--CLEAN--
<?php
-$dirname = dirname(__FILE__) . '/oo_addpattern_dir/';
+$dirname = __DIR__ . '/oo_addpattern_dir/';
unlink($dirname . 'tmp.zip');
unlink($dirname . 'foo.txt');
unlink($dirname . 'bar.txt');
diff --git a/ext/zip/tests/oo_close.phpt b/ext/zip/tests/oo_close.phpt
index 46ecfaf43a..60a7f364d1 100644
--- a/ext/zip/tests/oo_close.phpt
+++ b/ext/zip/tests/oo_close.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$zip = new ZipArchive;
if (!$zip->open($dirname . 'test.zip')) {
exit('failed');
diff --git a/ext/zip/tests/oo_count.phpt b/ext/zip/tests/oo_count.phpt
index a553e17156..a5771fa298 100644
--- a/ext/zip/tests/oo_count.phpt
+++ b/ext/zip/tests/oo_count.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test.zip';
$zip = new ZipArchive;
diff --git a/ext/zip/tests/oo_delete.phpt b/ext/zip/tests/oo_delete.phpt
index 20e1f38fda..cdf3ded336 100644
--- a/ext/zip/tests/oo_delete.phpt
+++ b/ext/zip/tests/oo_delete.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . '__tmp_oo_delete.zip';
if (file_exists($file)) {
unlink($file);
diff --git a/ext/zip/tests/oo_extract.phpt b/ext/zip/tests/oo_extract.phpt
index ef3e3406f3..d2ae2b5a43 100644
--- a/ext/zip/tests/oo_extract.phpt
+++ b/ext/zip/tests/oo_extract.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
include $dirname . 'utils.inc';
$zip = new ZipArchive;
diff --git a/ext/zip/tests/oo_getcomment.phpt b/ext/zip/tests/oo_getcomment.phpt
index b3da94e5f8..333dfa96bb 100644
--- a/ext/zip/tests/oo_getcomment.phpt
+++ b/ext/zip/tests/oo_getcomment.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
include $dirname . 'utils.inc';
$zip = new ZipArchive;
diff --git a/ext/zip/tests/oo_getnameindex.phpt b/ext/zip/tests/oo_getnameindex.phpt
index aa96b4cfbe..53ca490e7d 100644
--- a/ext/zip/tests/oo_getnameindex.phpt
+++ b/ext/zip/tests/oo_getnameindex.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_rename.zip';
diff --git a/ext/zip/tests/oo_getstatusstring.phpt b/ext/zip/tests/oo_getstatusstring.phpt
index 87462694ac..50d76a16b6 100644
--- a/ext/zip/tests/oo_getstatusstring.phpt
+++ b/ext/zip/tests/oo_getstatusstring.phpt
@@ -8,7 +8,7 @@ Ole-Petter Wikene <olepw@redpill-linpro.com>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$arch = new ZipArchive;
$arch->open($dirname.'foo.zip',ZIPARCHIVE::CREATE);
var_dump($arch->getStatusString());
diff --git a/ext/zip/tests/oo_namelocate.phpt b/ext/zip/tests/oo_namelocate.phpt
index 17f3cb9c28..639ee6803e 100644
--- a/ext/zip/tests/oo_namelocate.phpt
+++ b/ext/zip/tests/oo_namelocate.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_rename.zip';
diff --git a/ext/zip/tests/oo_open.phpt b/ext/zip/tests/oo_open.phpt
index 0b33cfb489..10ebad9441 100644
--- a/ext/zip/tests/oo_open.phpt
+++ b/ext/zip/tests/oo_open.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$zip = new ZipArchive;
$r = $zip->open($dirname . 'nofile');
if ($r !== TRUE) {
diff --git a/ext/zip/tests/oo_properties.phpt b/ext/zip/tests/oo_properties.phpt
index bcd6f2fc28..b435d6c159 100644
--- a/ext/zip/tests/oo_properties.phpt
+++ b/ext/zip/tests/oo_properties.phpt
@@ -7,7 +7,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . '__property_test.zip';
copy($dirname . 'test_with_comment.zip', $file);
diff --git a/ext/zip/tests/oo_rename.phpt b/ext/zip/tests/oo_rename.phpt
index fe54fd812b..1ec661eed2 100644
--- a/ext/zip/tests/oo_rename.phpt
+++ b/ext/zip/tests/oo_rename.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_rename.zip';
diff --git a/ext/zip/tests/oo_setcomment.phpt b/ext/zip/tests/oo_setcomment.phpt
index 0135084253..b22c2a27a8 100644
--- a/ext/zip/tests/oo_setcomment.phpt
+++ b/ext/zip/tests/oo_setcomment.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
include $dirname . 'utils.inc';
$file = $dirname . '__tmp_oo_set_comment.zip';
diff --git a/ext/zip/tests/oo_setcompression.phpt b/ext/zip/tests/oo_setcompression.phpt
index 4ea96acfa3..f19600a4ed 100644
--- a/ext/zip/tests/oo_setcompression.phpt
+++ b/ext/zip/tests/oo_setcompression.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$tmpfile = dirname(__FILE__) . '/__tmp_oo_set_compression.zip';
+$tmpfile = __DIR__ . '/__tmp_oo_set_compression.zip';
if (file_exists($tmpfile)) {
unlink($tmpfile);
@@ -52,7 +52,7 @@ zip_close($zip);
?>
--CLEAN--
<?php
-$tmpfile = dirname(__FILE__) . '/__tmp_oo_set_compression.zip';
+$tmpfile = __DIR__ . '/__tmp_oo_set_compression.zip';
unlink($tmpfile);
?>
--EXPECT--
diff --git a/ext/zip/tests/oo_stream.phpt b/ext/zip/tests/oo_stream.phpt
index 83fe7e8466..89a2711666 100644
--- a/ext/zip/tests/oo_stream.phpt
+++ b/ext/zip/tests/oo_stream.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
include $dirname . 'utils.inc';
$zip = new ZipArchive;
@@ -27,7 +27,7 @@ $zip->close();
var_dump($contents);
-$fp = fopen('zip://' . dirname(__FILE__) . '/test_with_comment.zip#foo', 'rb');
+$fp = fopen('zip://' . __DIR__ . '/test_with_comment.zip#foo', 'rb');
if (!$fp) {
exit("cannot open\n");
}
diff --git a/ext/zip/tests/oo_unchangeIndex.phpt b/ext/zip/tests/oo_unchangeIndex.phpt
index f4b5a9a82a..71647689ab 100644
--- a/ext/zip/tests/oo_unchangeIndex.phpt
+++ b/ext/zip/tests/oo_unchangeIndex.phpt
@@ -6,7 +6,7 @@ PHP TestFest 2017 - Bergfreunde, Florian Engelhardt
<?php if (!extension_loaded("zip")) print "skip"; ?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . '__tmp_oo_unchangeIndex.zip';
copy($dirname.'test.zip', $file);
diff --git a/ext/zip/tests/oo_unchangeName.phpt b/ext/zip/tests/oo_unchangeName.phpt
index 23dd0574af..c29ef2ca88 100644
--- a/ext/zip/tests/oo_unchangeName.phpt
+++ b/ext/zip/tests/oo_unchangeName.phpt
@@ -6,7 +6,7 @@ PHP TestFest 2017 - Bergfreunde, Florian Engelhardt
<?php if (!extension_loaded("zip")) print "skip"; ?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . '__tmp_oo_unchangeIndex.zip';
copy($dirname.'test.zip', $file);
diff --git a/ext/zip/tests/pecl12414.phpt b/ext/zip/tests/pecl12414.phpt
index fed9bf9d6b..1b728c0ebc 100644
--- a/ext/zip/tests/pecl12414.phpt
+++ b/ext/zip/tests/pecl12414.phpt
@@ -8,7 +8,7 @@ if(!extension_loaded('zip')) die('skip');
--FILE--
<?php
$filename = 'MYLOGOV2.GFX';
-$zipname = dirname(__FILE__) . "/pecl12414.zip";
+$zipname = __DIR__ . "/pecl12414.zip";
$za = new ZipArchive();
$res =$za->open($zipname);
if ($res === TRUE) {
diff --git a/ext/zip/tests/stream_meta_data.phpt b/ext/zip/tests/stream_meta_data.phpt
index 11d4d88aea..26453af134 100644
--- a/ext/zip/tests/stream_meta_data.phpt
+++ b/ext/zip/tests/stream_meta_data.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$dirname = dirname(__FILE__) . '/';
+$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
include $dirname . 'utils.inc';
$zip = new ZipArchive;
@@ -23,7 +23,7 @@ fclose($fp);
$zip->close();
-$fp = fopen('zip://' . dirname(__FILE__) . '/test_with_comment.zip#foo', 'rb');
+$fp = fopen('zip://' . __DIR__ . '/test_with_comment.zip#foo', 'rb');
if (!$fp) {
exit("cannot open\n");
}
diff --git a/ext/zip/tests/zip_close.phpt b/ext/zip/tests/zip_close.phpt
index d95f6da3c2..5df226e0ee 100644
--- a/ext/zip/tests/zip_close.phpt
+++ b/ext/zip/tests/zip_close.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
if (!is_resource($zip)) die("Failure");
zip_close($zip);
echo "OK";
diff --git a/ext/zip/tests/zip_entry_close.phpt b/ext/zip/tests/zip_entry_close.phpt
index aed4acc661..2f2581b2d0 100644
--- a/ext/zip/tests/zip_entry_close.phpt
+++ b/ext/zip/tests/zip_entry_close.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
$entry = zip_read($zip);
echo "entry_open: "; var_dump(zip_entry_open($zip, $entry, "r"));
echo "entry_close: "; var_dump(zip_entry_close($entry));
diff --git a/ext/zip/tests/zip_entry_compressedsize.phpt b/ext/zip/tests/zip_entry_compressedsize.phpt
index cc59a0e318..1356bac343 100644
--- a/ext/zip/tests/zip_entry_compressedsize.phpt
+++ b/ext/zip/tests/zip_entry_compressedsize.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
if (!is_resource($zip)) die("Failure");
$entries = 0;
while ($entry = zip_read($zip)) {
diff --git a/ext/zip/tests/zip_entry_compressionmethod.phpt b/ext/zip/tests/zip_entry_compressionmethod.phpt
index 0695256b77..f8b4863716 100644
--- a/ext/zip/tests/zip_entry_compressionmethod.phpt
+++ b/ext/zip/tests/zip_entry_compressionmethod.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
if (!is_resource($zip)) die("Failure");
$entries = 0;
while ($entry = zip_read($zip)) {
diff --git a/ext/zip/tests/zip_entry_filesize.phpt b/ext/zip/tests/zip_entry_filesize.phpt
index db69bbf61a..1498682215 100644
--- a/ext/zip/tests/zip_entry_filesize.phpt
+++ b/ext/zip/tests/zip_entry_filesize.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
if (!is_resource($zip)) die("Failure");
$entries = 0;
while ($entry = zip_read($zip)) {
diff --git a/ext/zip/tests/zip_entry_name.phpt b/ext/zip/tests/zip_entry_name.phpt
index 91b6f5c82e..486777a0b1 100644
--- a/ext/zip/tests/zip_entry_name.phpt
+++ b/ext/zip/tests/zip_entry_name.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
if (!is_resource($zip)) die("Failure");
$entries = 0;
while ($entry = zip_read($zip)) {
diff --git a/ext/zip/tests/zip_entry_open.phpt b/ext/zip/tests/zip_entry_open.phpt
index 9b7a388323..3c7fa28714 100644
--- a/ext/zip/tests/zip_entry_open.phpt
+++ b/ext/zip/tests/zip_entry_open.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
$entry = zip_read($zip);
echo zip_entry_open($zip, $entry, "r") ? "OK" : "Failure";
zip_entry_close($entry);
diff --git a/ext/zip/tests/zip_entry_read.phpt b/ext/zip/tests/zip_entry_read.phpt
index bb136ceef1..a9800b5cc4 100644
--- a/ext/zip/tests/zip_entry_read.phpt
+++ b/ext/zip/tests/zip_entry_read.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
$entry = zip_read($zip);
if (!zip_entry_open($zip, $entry, "r")) die("Failure");
echo zip_entry_read($entry);
diff --git a/ext/zip/tests/zip_open.phpt b/ext/zip/tests/zip_open.phpt
index 6b176532ce..8cd714da0c 100644
--- a/ext/zip/tests/zip_open.phpt
+++ b/ext/zip/tests/zip_open.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
echo is_resource($zip) ? "OK" : "Failure";
diff --git a/ext/zip/tests/zip_read.phpt b/ext/zip/tests/zip_read.phpt
index 743ab05626..5cd2e9755a 100644
--- a/ext/zip/tests/zip_read.phpt
+++ b/ext/zip/tests/zip_read.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
-$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$zip = zip_open(__DIR__."/test_procedural.zip");
if (!is_resource($zip)) die("Failure");
$entries = 0;
while ($entry = zip_read($zip)) {