summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authorFabien Villepinte <fabien.villepinte@gmail.com>2019-03-15 22:55:30 +0100
committerPeter Kokot <peterkokot@gmail.com>2019-03-15 22:55:30 +0100
commit26dfce7f36d1c6f737ac241df1315a1b42b932c7 (patch)
tree570279b2f4d66a3de7f6ff7f7c865654ad04cea4 /ext/zlib
parent63802a8446691869371bb37078d55b99cae7eb95 (diff)
downloadphp-git-26dfce7f36d1c6f737ac241df1315a1b42b932c7.tar.gz
Replace dirname(__FILE__) by __DIR__ in tests
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/tests/004-mb.phpt4
-rw-r--r--ext/zlib/tests/004.phpt4
-rw-r--r--ext/zlib/tests/bug_40189.phpt6
-rw-r--r--ext/zlib/tests/bug_52944.phpt2
-rw-r--r--ext/zlib/tests/compress_zlib_wrapper.phpt4
-rw-r--r--ext/zlib/tests/gzclose_basic.phpt2
-rw-r--r--ext/zlib/tests/gzcompress_basic1.phpt2
-rw-r--r--ext/zlib/tests/gzcompress_variation1.phpt2
-rw-r--r--ext/zlib/tests/gzdeflate_basic1.phpt2
-rw-r--r--ext/zlib/tests/gzdeflate_variation1.phpt2
-rw-r--r--ext/zlib/tests/gzencode_basic1.phpt2
-rw-r--r--ext/zlib/tests/gzencode_variation1-win32.phpt2
-rw-r--r--ext/zlib/tests/gzencode_variation1.phpt2
-rw-r--r--ext/zlib/tests/gzeof_basic.phpt2
-rw-r--r--ext/zlib/tests/gzeof_variation1.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation11.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation12.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation9.phpt2
-rw-r--r--ext/zlib/tests/gzgetc_basic.phpt2
-rw-r--r--ext/zlib/tests/gzgetc_basic_1.phpt2
-rw-r--r--ext/zlib/tests/gzgets_basic.phpt2
-rw-r--r--ext/zlib/tests/gzinflate_error1.phpt2
-rw-r--r--ext/zlib/tests/gzopen_basic.phpt2
-rw-r--r--ext/zlib/tests/gzopen_variation7.phpt2
-rw-r--r--ext/zlib/tests/gzopen_variation9.phpt2
-rw-r--r--ext/zlib/tests/gzpassthru_basic.phpt2
-rw-r--r--ext/zlib/tests/gzputs_basic.phpt2
-rw-r--r--ext/zlib/tests/gzread_basic.phpt2
-rw-r--r--ext/zlib/tests/gzread_error2.phpt2
-rw-r--r--ext/zlib/tests/gzrewind_basic.phpt2
-rw-r--r--ext/zlib/tests/gzrewind_basic2.phpt2
-rw-r--r--ext/zlib/tests/gzseek_basic.phpt2
-rw-r--r--ext/zlib/tests/gzseek_variation2.phpt2
-rw-r--r--ext/zlib/tests/gzseek_variation3.phpt2
-rw-r--r--ext/zlib/tests/gzseek_variation6.phpt2
-rw-r--r--ext/zlib/tests/gztell_basic.phpt2
-rw-r--r--ext/zlib/tests/gzuncompress_basic1.phpt2
-rw-r--r--ext/zlib/tests/gzwrite_variation1.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation10.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation11.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation12.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation9.phpt2
-rw-r--r--ext/zlib/tests/zlib_filter_inflate2.phpt12
-rw-r--r--ext/zlib/tests/zlib_scheme_copy_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_copy_variation1.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_dir_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_file_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_fopen_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_fopen_variation1.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_rename_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_stat_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_stat_basic2.phpt2
-rw-r--r--ext/zlib/tests/zlib_scheme_unlink_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_wrapper_flock_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_wrapper_fstat_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt2
-rw-r--r--ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt4
59 files changed, 70 insertions, 70 deletions
diff --git a/ext/zlib/tests/004-mb.phpt b/ext/zlib/tests/004-mb.phpt
index 92f7db1b70..07a26e5294 100644
--- a/ext/zlib/tests/004-mb.phpt
+++ b/ext/zlib/tests/004-mb.phpt
@@ -9,8 +9,8 @@ var_dump(gzfile());
var_dump(gzfile("nonexistent_file_gzfile",1));
var_dump(gzfile(1,1,1));
-var_dump(gzfile(dirname(__FILE__)."/004私はガラスを食べられます.txt.gz"));
-var_dump(gzfile(dirname(__FILE__)."/004私はガラスを食べられます.txt.gz", 1));
+var_dump(gzfile(__DIR__."/004私はガラスを食べられます.txt.gz"));
+var_dump(gzfile(__DIR__."/004私はガラスを食べられます.txt.gz", 1));
echo "Done\n";
?>
diff --git a/ext/zlib/tests/004.phpt b/ext/zlib/tests/004.phpt
index b8d0f0eccd..7689ad0cf1 100644
--- a/ext/zlib/tests/004.phpt
+++ b/ext/zlib/tests/004.phpt
@@ -9,8 +9,8 @@ var_dump(gzfile());
var_dump(gzfile("nonexistent_file_gzfile",1));
var_dump(gzfile(1,1,1));
-var_dump(gzfile(dirname(__FILE__)."/004.txt.gz"));
-var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", 1));
+var_dump(gzfile(__DIR__."/004.txt.gz"));
+var_dump(gzfile(__DIR__."/004.txt.gz", 1));
echo "Done\n";
?>
diff --git a/ext/zlib/tests/bug_40189.phpt b/ext/zlib/tests/bug_40189.phpt
index aedf0619a1..53226c0599 100644
--- a/ext/zlib/tests/bug_40189.phpt
+++ b/ext/zlib/tests/bug_40189.phpt
@@ -9,17 +9,17 @@ allow_url_fopen=1
// this string is an excerpt of a phar archive that caused an infinite loop
$a = "\x3\x0\x85\x46\x2f\x7c\xc2\xaa\x69\x2b\x6d\xe5\xdb\xfe\xe4\x21\x8f\x0\x97\x21\x1d\x2\x0\x0\x0\x47\x42\x4d\x42";
var_dump(base64_encode($a));
-$gp = fopen(dirname(__FILE__) . '/test.other', 'wb');
+$gp = fopen(__DIR__ . '/test.other', 'wb');
$fp = fopen('data://text/plain;base64,AwCFRi98wqppK23l2/7kIY8AlyEdAgAAAEdCTUI=', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
var_dump(stream_copy_to_stream($fp, $gp, 5));
fclose($fp);
fclose($gp);
-var_dump(file_get_contents(dirname(__FILE__) . '/test.other'));
+var_dump(file_get_contents(__DIR__ . '/test.other'));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . '/test.other');
+@unlink(__DIR__ . '/test.other');
?>
--EXPECT--
string(40) "AwCFRi98wqppK23l2/7kIY8AlyEdAgAAAEdCTUI="
diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt
index 4edc147db9..e5c6694158 100644
--- a/ext/zlib/tests/bug_52944.phpt
+++ b/ext/zlib/tests/bug_52944.phpt
@@ -10,7 +10,7 @@ allow_url_fopen=1
1.2.7 on at least Windows and Darwin. Using unoptimized
zlib build fixes the issue. */
-require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+require __DIR__ . "/bug_52944_corrupted_data.inc";
$fp = fopen('data://text/plain;base64,' . $data, 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
diff --git a/ext/zlib/tests/compress_zlib_wrapper.phpt b/ext/zlib/tests/compress_zlib_wrapper.phpt
index 4bf6c08317..1d11722129 100644
--- a/ext/zlib/tests/compress_zlib_wrapper.phpt
+++ b/ext/zlib/tests/compress_zlib_wrapper.phpt
@@ -4,7 +4,7 @@ compress.zlib:// wrapper
<?php if (!extension_loaded("zlib")) die("skip"); ?>
--FILE--
<?php
-chdir(dirname(__FILE__). "/../../..");
+chdir(__DIR__. "/../../..");
$pfx = str_repeat('../', substr_count($_SERVER['PHP_SELF'], '../'));
@@ -13,7 +13,7 @@ $fp = fopen("compress.zlib://{$pfx}ext/xsl/tests/xslt.xsl.gz", "rb");
fclose($fp);
// Absolute path
-$fp = fopen("compress.zlib://". dirname(__FILE__). "/../../../ext/xsl/tests/xslt.xsl.gz", "rb");
+$fp = fopen("compress.zlib://". __DIR__. "/../../../ext/xsl/tests/xslt.xsl.gz", "rb");
fclose($fp);
echo "ok\n";
diff --git a/ext/zlib/tests/gzclose_basic.phpt b/ext/zlib/tests/gzclose_basic.phpt
index 9a84111781..0393db2c57 100644
--- a/ext/zlib/tests/gzclose_basic.phpt
+++ b/ext/zlib/tests/gzclose_basic.phpt
@@ -11,7 +11,7 @@ if (!extension_loaded("zlib")) {
// note that gzclose is an alias to fclose. parameter checking tests will be
// the same as fclose
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
gzread($h, 20);
var_dump(gzclose($h));
diff --git a/ext/zlib/tests/gzcompress_basic1.phpt b/ext/zlib/tests/gzcompress_basic1.phpt
index 9d5fcedcf8..882fd87fad 100644
--- a/ext/zlib/tests/gzcompress_basic1.phpt
+++ b/ext/zlib/tests/gzcompress_basic1.phpt
@@ -18,7 +18,7 @@ if (!extension_loaded("zlib")) {
* add a comment here to say what the test is supposed to do
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzcompress() : basic functionality ***\n";
diff --git a/ext/zlib/tests/gzcompress_variation1.phpt b/ext/zlib/tests/gzcompress_variation1.phpt
index de1671545a..c4bc0a1ff5 100644
--- a/ext/zlib/tests/gzcompress_variation1.phpt
+++ b/ext/zlib/tests/gzcompress_variation1.phpt
@@ -14,7 +14,7 @@ if (!extension_loaded("zlib")) {
* Alias to functions:
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzcompress() : variation ***\n";
diff --git a/ext/zlib/tests/gzdeflate_basic1.phpt b/ext/zlib/tests/gzdeflate_basic1.phpt
index 5f25a1880b..8ab0ee6243 100644
--- a/ext/zlib/tests/gzdeflate_basic1.phpt
+++ b/ext/zlib/tests/gzdeflate_basic1.phpt
@@ -18,7 +18,7 @@ if (!extension_loaded("zlib")) {
* add a comment here to say what the test is supposed to do
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzdeflate() : basic functionality ***\n";
diff --git a/ext/zlib/tests/gzdeflate_variation1.phpt b/ext/zlib/tests/gzdeflate_variation1.phpt
index dc8b9d1fcd..7993abb529 100644
--- a/ext/zlib/tests/gzdeflate_variation1.phpt
+++ b/ext/zlib/tests/gzdeflate_variation1.phpt
@@ -14,7 +14,7 @@ if (!extension_loaded("zlib")) {
* Alias to functions:
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzdeflate() : variation ***\n";
diff --git a/ext/zlib/tests/gzencode_basic1.phpt b/ext/zlib/tests/gzencode_basic1.phpt
index c6040135f0..dfb09cc2ed 100644
--- a/ext/zlib/tests/gzencode_basic1.phpt
+++ b/ext/zlib/tests/gzencode_basic1.phpt
@@ -18,7 +18,7 @@ if (!extension_loaded("zlib")) {
* Test basic function of gzencode
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzencode() : basic functionality ***\n";
diff --git a/ext/zlib/tests/gzencode_variation1-win32.phpt b/ext/zlib/tests/gzencode_variation1-win32.phpt
index 4feb7d653c..798924f9fe 100644
--- a/ext/zlib/tests/gzencode_variation1-win32.phpt
+++ b/ext/zlib/tests/gzencode_variation1-win32.phpt
@@ -27,7 +27,7 @@ if(!function_exists("gzdecode")) {
}
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzencode() : variation ***\n";
diff --git a/ext/zlib/tests/gzencode_variation1.phpt b/ext/zlib/tests/gzencode_variation1.phpt
index 1c82da98f8..c966b2cbc5 100644
--- a/ext/zlib/tests/gzencode_variation1.phpt
+++ b/ext/zlib/tests/gzencode_variation1.phpt
@@ -19,7 +19,7 @@ if (!extension_loaded("zlib")) {
* Alias to functions:
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzencode() : variation ***\n";
diff --git a/ext/zlib/tests/gzeof_basic.phpt b/ext/zlib/tests/gzeof_basic.phpt
index 6ee8d8e181..33d46599c3 100644
--- a/ext/zlib/tests/gzeof_basic.phpt
+++ b/ext/zlib/tests/gzeof_basic.phpt
@@ -11,7 +11,7 @@ if (!extension_loaded("zlib")) {
// note that gzeof is an alias to gzeof. parameter checking tests will be
// the same as gzeof
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
echo "-- test 1 --\n";
$h = gzopen($f, 'r');
diff --git a/ext/zlib/tests/gzeof_variation1.phpt b/ext/zlib/tests/gzeof_variation1.phpt
index 9e30775928..4a845917af 100644
--- a/ext/zlib/tests/gzeof_variation1.phpt
+++ b/ext/zlib/tests/gzeof_variation1.phpt
@@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) {
--FILE--
<?php
-$filename = dirname(__FILE__)."/gzeof_variation1.txt.gz";
+$filename = __DIR__."/gzeof_variation1.txt.gz";
$h = gzopen($filename, 'w');
$str = "Here is the string to be written. ";
$length = 10;
diff --git a/ext/zlib/tests/gzfile_variation11.phpt b/ext/zlib/tests/gzfile_variation11.phpt
index ba25bf570f..76f0a537b5 100644
--- a/ext/zlib/tests/gzfile_variation11.phpt
+++ b/ext/zlib/tests/gzfile_variation11.phpt
@@ -9,7 +9,7 @@ if (PHP_INT_SIZE != 8) die('skip 64-bit only');
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$variation = array(
diff --git a/ext/zlib/tests/gzfile_variation12.phpt b/ext/zlib/tests/gzfile_variation12.phpt
index e16a91822b..6b9aec5334 100644
--- a/ext/zlib/tests/gzfile_variation12.phpt
+++ b/ext/zlib/tests/gzfile_variation12.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('zlib')) die ('skip zlib extension not available in this b
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$variation = array (
diff --git a/ext/zlib/tests/gzfile_variation9.phpt b/ext/zlib/tests/gzfile_variation9.phpt
index 6cb5a53331..8fa994026f 100644
--- a/ext/zlib/tests/gzfile_variation9.phpt
+++ b/ext/zlib/tests/gzfile_variation9.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('zlib')) die ('skip zlib extension not available in this b
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$variation = array(
'lowercase true' => true,
diff --git a/ext/zlib/tests/gzgetc_basic.phpt b/ext/zlib/tests/gzgetc_basic.phpt
index ad8684381b..73dc128bf2 100644
--- a/ext/zlib/tests/gzgetc_basic.phpt
+++ b/ext/zlib/tests/gzgetc_basic.phpt
@@ -16,7 +16,7 @@ if (version_compare(get_zlib_version(), '1.2.5') > 0) {
// note that gzgets is an alias to fgets. parameter checking tests will be
// the same as gzgets
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
$count = 0;
diff --git a/ext/zlib/tests/gzgetc_basic_1.phpt b/ext/zlib/tests/gzgetc_basic_1.phpt
index 24d847eb64..b555877c8c 100644
--- a/ext/zlib/tests/gzgetc_basic_1.phpt
+++ b/ext/zlib/tests/gzgetc_basic_1.phpt
@@ -16,7 +16,7 @@ if (version_compare(get_zlib_version(), '1.2.7') < 0) {
// note that gzgets is an alias to fgets. parameter checking tests will be
// the same as gzgets
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
if ($h) {
$count = 0;
diff --git a/ext/zlib/tests/gzgets_basic.phpt b/ext/zlib/tests/gzgets_basic.phpt
index 20d43e1eb3..8f2e1c0a20 100644
--- a/ext/zlib/tests/gzgets_basic.phpt
+++ b/ext/zlib/tests/gzgets_basic.phpt
@@ -12,7 +12,7 @@ if (!extension_loaded("zlib")) {
// note that gzgets is an alias to fgets. parameter checking tests will be
// the same as fgets
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
$lengths = array(10, 14, 7, 99);
foreach ($lengths as $length) {
diff --git a/ext/zlib/tests/gzinflate_error1.phpt b/ext/zlib/tests/gzinflate_error1.phpt
index cbfe615511..fd65f54e55 100644
--- a/ext/zlib/tests/gzinflate_error1.phpt
+++ b/ext/zlib/tests/gzinflate_error1.phpt
@@ -14,7 +14,7 @@ if (!extension_loaded("zlib")) {
* Alias to functions:
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzinflate() : error conditions ***\n";
diff --git a/ext/zlib/tests/gzopen_basic.phpt b/ext/zlib/tests/gzopen_basic.phpt
index d41e1c40de..4ef34aea68 100644
--- a/ext/zlib/tests/gzopen_basic.phpt
+++ b/ext/zlib/tests/gzopen_basic.phpt
@@ -18,7 +18,7 @@ echo "*** Testing gzopen() : basic functionality ***\n";
// Initialise all required variables
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$mode = 'r';
$use_include_path = false;
diff --git a/ext/zlib/tests/gzopen_variation7.phpt b/ext/zlib/tests/gzopen_variation7.phpt
index cc627374bf..0e499e0d37 100644
--- a/ext/zlib/tests/gzopen_variation7.phpt
+++ b/ext/zlib/tests/gzopen_variation7.phpt
@@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) {
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h1 = gzopen($f, 'r');
$h2 = gzopen($f, 'r');
diff --git a/ext/zlib/tests/gzopen_variation9.phpt b/ext/zlib/tests/gzopen_variation9.phpt
index b308316335..d948b435ca 100644
--- a/ext/zlib/tests/gzopen_variation9.phpt
+++ b/ext/zlib/tests/gzopen_variation9.phpt
@@ -18,7 +18,7 @@ echo "*** Testing gzopen() : variation ***\n";
$modes = array('r+', 'rf', 'w+' , 'e');
-$file = dirname(__FILE__)."/004.txt.gz";
+$file = __DIR__."/004.txt.gz";
foreach ($modes as $mode) {
echo "mode=$mode\n";
diff --git a/ext/zlib/tests/gzpassthru_basic.phpt b/ext/zlib/tests/gzpassthru_basic.phpt
index 10ff6630b2..2747edc786 100644
--- a/ext/zlib/tests/gzpassthru_basic.phpt
+++ b/ext/zlib/tests/gzpassthru_basic.phpt
@@ -12,7 +12,7 @@ if (!extension_loaded("zlib")) {
// note that gzpassthru is an alias to fpassthru. parameter checking tests will be
// the same as fpassthru
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
var_dump(gzpassthru($h));
var_dump(gzpassthru($h));
diff --git a/ext/zlib/tests/gzputs_basic.phpt b/ext/zlib/tests/gzputs_basic.phpt
index 72173bb7b9..a9bd682c14 100644
--- a/ext/zlib/tests/gzputs_basic.phpt
+++ b/ext/zlib/tests/gzputs_basic.phpt
@@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) {
--FILE--
<?php
-$filename = dirname(__FILE__)."/gzputs_basic.txt.gz";
+$filename = __DIR__."/gzputs_basic.txt.gz";
$h = gzopen($filename, 'w');
$str = "Here is the string to be written. ";
$length = 10;
diff --git a/ext/zlib/tests/gzread_basic.phpt b/ext/zlib/tests/gzread_basic.phpt
index b41720c396..813fcd8616 100644
--- a/ext/zlib/tests/gzread_basic.phpt
+++ b/ext/zlib/tests/gzread_basic.phpt
@@ -11,7 +11,7 @@ if (!extension_loaded("zlib")) {
// note that gzread is an alias to fread. parameter checking tests will be
// the same as fread
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
$lengths = array(10, 14, 7, 99, 2000);
diff --git a/ext/zlib/tests/gzread_error2.phpt b/ext/zlib/tests/gzread_error2.phpt
index 5b97993482..a419f96640 100644
--- a/ext/zlib/tests/gzread_error2.phpt
+++ b/ext/zlib/tests/gzread_error2.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
var_dump(gzread($h, 10));
var_dump(gzread($h, 0));
diff --git a/ext/zlib/tests/gzrewind_basic.phpt b/ext/zlib/tests/gzrewind_basic.phpt
index e415a0e105..3a34f49797 100644
--- a/ext/zlib/tests/gzrewind_basic.phpt
+++ b/ext/zlib/tests/gzrewind_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
echo "test rewind before doing anything\n";
var_dump(gzrewind($h));
diff --git a/ext/zlib/tests/gzrewind_basic2.phpt b/ext/zlib/tests/gzrewind_basic2.phpt
index 277d8a02ad..2648966b7d 100644
--- a/ext/zlib/tests/gzrewind_basic2.phpt
+++ b/ext/zlib/tests/gzrewind_basic2.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
// read to the end of the file
diff --git a/ext/zlib/tests/gzseek_basic.phpt b/ext/zlib/tests/gzseek_basic.phpt
index 8ef4ef070d..e31e25f380 100644
--- a/ext/zlib/tests/gzseek_basic.phpt
+++ b/ext/zlib/tests/gzseek_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
echo "move to the 50th byte\n";
diff --git a/ext/zlib/tests/gzseek_variation2.phpt b/ext/zlib/tests/gzseek_variation2.phpt
index 6063f42b4d..14ae30a09a 100644
--- a/ext/zlib/tests/gzseek_variation2.phpt
+++ b/ext/zlib/tests/gzseek_variation2.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
echo "move to the 50th byte\n";
diff --git a/ext/zlib/tests/gzseek_variation3.phpt b/ext/zlib/tests/gzseek_variation3.phpt
index 196f69361e..d238fe96bd 100644
--- a/ext/zlib/tests/gzseek_variation3.phpt
+++ b/ext/zlib/tests/gzseek_variation3.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
echo "move to the 50th byte\n";
diff --git a/ext/zlib/tests/gzseek_variation6.phpt b/ext/zlib/tests/gzseek_variation6.phpt
index 888adac310..54a52dce3c 100644
--- a/ext/zlib/tests/gzseek_variation6.phpt
+++ b/ext/zlib/tests/gzseek_variation6.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
// move 40 bytes
echo "move 40 bytes\n";
diff --git a/ext/zlib/tests/gztell_basic.phpt b/ext/zlib/tests/gztell_basic.phpt
index 3e33fcd3fc..181295c097 100644
--- a/ext/zlib/tests/gztell_basic.phpt
+++ b/ext/zlib/tests/gztell_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, 'r');
$intervals = array(7, 22, 54, 17, 27, 15, 1000);
// tell should be 7, 29, 83, 100, 127, 142, 176 (176 is length of uncompressed file)
diff --git a/ext/zlib/tests/gzuncompress_basic1.phpt b/ext/zlib/tests/gzuncompress_basic1.phpt
index 3d593e466c..6107a59e4f 100644
--- a/ext/zlib/tests/gzuncompress_basic1.phpt
+++ b/ext/zlib/tests/gzuncompress_basic1.phpt
@@ -14,7 +14,7 @@ if (!extension_loaded("zlib")) {
* Alias to functions:
*/
-include(dirname(__FILE__) . '/data.inc');
+include(__DIR__ . '/data.inc');
echo "*** Testing gzuncompress() : basic functionality ***\n";
diff --git a/ext/zlib/tests/gzwrite_variation1.phpt b/ext/zlib/tests/gzwrite_variation1.phpt
index aa556ca5a4..6061ef1a0f 100644
--- a/ext/zlib/tests/gzwrite_variation1.phpt
+++ b/ext/zlib/tests/gzwrite_variation1.phpt
@@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) {
--FILE--
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$h = gzopen($filename, 'r');
$str = "Here is the string to be written. ";
$length = 10;
diff --git a/ext/zlib/tests/readgzfile_variation10.phpt b/ext/zlib/tests/readgzfile_variation10.phpt
index 004a07775a..731445dbf0 100644
--- a/ext/zlib/tests/readgzfile_variation10.phpt
+++ b/ext/zlib/tests/readgzfile_variation10.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('zlib')) die ('skip zlib extension not available in this b
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$unset_var = 10;
diff --git a/ext/zlib/tests/readgzfile_variation11.phpt b/ext/zlib/tests/readgzfile_variation11.phpt
index 6dd9c2ff39..87eb8ac7c8 100644
--- a/ext/zlib/tests/readgzfile_variation11.phpt
+++ b/ext/zlib/tests/readgzfile_variation11.phpt
@@ -9,7 +9,7 @@ if (PHP_INT_SIZE != 8) die('skip 64-bit only');
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$variation = array(
diff --git a/ext/zlib/tests/readgzfile_variation12.phpt b/ext/zlib/tests/readgzfile_variation12.phpt
index 82e7b07a5d..af22ce6f6c 100644
--- a/ext/zlib/tests/readgzfile_variation12.phpt
+++ b/ext/zlib/tests/readgzfile_variation12.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('zlib')) die ('skip zlib extension not available in this b
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$variation = array (
diff --git a/ext/zlib/tests/readgzfile_variation9.phpt b/ext/zlib/tests/readgzfile_variation9.phpt
index 50fdd62f06..4f7b7d30c0 100644
--- a/ext/zlib/tests/readgzfile_variation9.phpt
+++ b/ext/zlib/tests/readgzfile_variation9.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('zlib')) die ('skip zlib extension not available in this b
<?php
-$filename = dirname(__FILE__)."/004.txt.gz";
+$filename = __DIR__."/004.txt.gz";
$variation = array(
'lowercase true' => true,
diff --git a/ext/zlib/tests/zlib_filter_inflate2.phpt b/ext/zlib/tests/zlib_filter_inflate2.phpt
index 67b7e8aa42..7dd2ebb594 100644
--- a/ext/zlib/tests/zlib_filter_inflate2.phpt
+++ b/ext/zlib/tests/zlib_filter_inflate2.phpt
@@ -5,24 +5,24 @@ zlib.inflate of gzip-encoded stream
--FILE--
<?php
-$a = gzopen(dirname(__FILE__) . '/test.txt.gz', 'w');
+$a = gzopen(__DIR__ . '/test.txt.gz', 'w');
fwrite($a, "This is quite the thing ain't it\n");
fclose($a);
-$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
+$fp = fopen(__DIR__ . '/test.txt.gz', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
echo fread($fp, 2000);
fclose($fp);
echo "1\n";
-$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
+$fp = fopen(__DIR__ . '/test.txt.gz', 'r');
// zlib format
-$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
+$fp = fopen(__DIR__ . '/test.txt.gz', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 15+16));
echo "2\n";
echo fread($fp, 2000);
fclose($fp);
// auto-detect
-$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
+$fp = fopen(__DIR__ . '/test.txt.gz', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 15+32));
echo "3\n";
echo fread($fp, 2000);
@@ -31,7 +31,7 @@ fclose($fp);
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . '/test.txt.gz');
+@unlink(__DIR__ . '/test.txt.gz');
?>
--EXPECT--
1
diff --git a/ext/zlib/tests/zlib_scheme_copy_basic.phpt b/ext/zlib/tests/zlib_scheme_copy_basic.phpt
index 179545ee44..a295c84bc5 100644
--- a/ext/zlib/tests/zlib_scheme_copy_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_copy_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$outputFileName = __FILE__.'.tmp';
$srcFile = "compress.zlib://$inputFileName";
diff --git a/ext/zlib/tests/zlib_scheme_copy_variation1.phpt b/ext/zlib/tests/zlib_scheme_copy_variation1.phpt
index 728275986d..4130aa4508 100644
--- a/ext/zlib/tests/zlib_scheme_copy_variation1.phpt
+++ b/ext/zlib/tests/zlib_scheme_copy_variation1.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$outputFileName = __FILE__.'.tmp';
$srcFile = "compress.zlib://$inputFileName";
diff --git a/ext/zlib/tests/zlib_scheme_dir_basic.phpt b/ext/zlib/tests/zlib_scheme_dir_basic.phpt
index 41a2683f06..768cdb23a1 100644
--- a/ext/zlib/tests/zlib_scheme_dir_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_dir_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/dir.gz";
+$inputFileName = __DIR__."/dir.gz";
$srcFile = "compress.zlib://$inputFileName";
var_dump(mkdir($srcFile));
var_dump(is_dir($srcFile));
diff --git a/ext/zlib/tests/zlib_scheme_file_basic.phpt b/ext/zlib/tests/zlib_scheme_file_basic.phpt
index c2264159bb..b978e35915 100644
--- a/ext/zlib/tests/zlib_scheme_file_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_file_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
$contents = file($srcFile);
var_dump($contents);
diff --git a/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt b/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt
index 3882389b16..e98e4e8ca6 100644
--- a/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
$contents = file_get_contents($srcFile);
echo $contents;
diff --git a/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt b/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt
index 99ff70de79..c0862d31a9 100644
--- a/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
readfile($srcFile);
?>
diff --git a/ext/zlib/tests/zlib_scheme_fopen_basic.phpt b/ext/zlib/tests/zlib_scheme_fopen_basic.phpt
index a282aa9c3b..d06276a5f4 100644
--- a/ext/zlib/tests/zlib_scheme_fopen_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_fopen_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
$h = fopen($srcFile, 'r');
fpassthru($h);
diff --git a/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt b/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt
index 670d67532d..a57d52f567 100644
--- a/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt
+++ b/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "file://$inputFileName";
$compressedFile = "compress.zlib://$srcFile";
diff --git a/ext/zlib/tests/zlib_scheme_rename_basic.phpt b/ext/zlib/tests/zlib_scheme_rename_basic.phpt
index 53bc70a4cf..e7225b6d81 100644
--- a/ext/zlib/tests/zlib_scheme_rename_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_rename_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
rename($srcFile, 'something.tmp');
var_dump(file_exists($inputFileName));
diff --git a/ext/zlib/tests/zlib_scheme_stat_basic.phpt b/ext/zlib/tests/zlib_scheme_stat_basic.phpt
index 80c26bd62a..d7997e2ebd 100644
--- a/ext/zlib/tests/zlib_scheme_stat_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_stat_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
stat($srcFile);
lstat($srcFile);
diff --git a/ext/zlib/tests/zlib_scheme_stat_basic2.phpt b/ext/zlib/tests/zlib_scheme_stat_basic2.phpt
index 8081fc805b..e74504939e 100644
--- a/ext/zlib/tests/zlib_scheme_stat_basic2.phpt
+++ b/ext/zlib/tests/zlib_scheme_stat_basic2.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
echo "file_exists=";
var_dump(file_exists($srcFile));
diff --git a/ext/zlib/tests/zlib_scheme_unlink_basic.phpt b/ext/zlib/tests/zlib_scheme_unlink_basic.phpt
index afa62f51f5..cb2734d905 100644
--- a/ext/zlib/tests/zlib_scheme_unlink_basic.phpt
+++ b/ext/zlib/tests/zlib_scheme_unlink_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$inputFileName = dirname(__FILE__)."/004.txt.gz";
+$inputFileName = __DIR__."/004.txt.gz";
$srcFile = "compress.zlib://$inputFileName";
unlink($srcFile);
var_dump(file_exists($inputFileName));
diff --git a/ext/zlib/tests/zlib_wrapper_flock_basic.phpt b/ext/zlib/tests/zlib_wrapper_flock_basic.phpt
index f8b776ae33..e32f116420 100644
--- a/ext/zlib/tests/zlib_wrapper_flock_basic.phpt
+++ b/ext/zlib/tests/zlib_wrapper_flock_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f,'r');
var_dump(flock($h, LOCK_SH));
gzclose($h);
diff --git a/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt b/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt
index 4996d9e2c7..cb7cf915ff 100644
--- a/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt
+++ b/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f, "r");
var_dump(fstat($h));
fclose($h);
diff --git a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt
index 0bc6f4f3e0..674243ab5c 100644
--- a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt
+++ b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$f2 = "zlib_wrapper_ftruncate_basic.txt.gz";
copy($f, $f2);
diff --git a/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt b/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt
index 1a2993acbf..591b93d075 100644
--- a/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt
+++ b/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt
@@ -9,12 +9,12 @@ if (!extension_loaded("zlib")) {
--FILE--
<?php
echo "no wrapper\n";
-$f = dirname(__FILE__)."/004.txt.gz";
+$f = __DIR__."/004.txt.gz";
$h = gzopen($f,'r');
var_dump(stream_get_meta_data($h));
gzclose($h);
echo "\nwith wrapper\n";
-$f = "compress.zlib://".dirname(__FILE__)."/004.txt.gz";
+$f = "compress.zlib://".__DIR__."/004.txt.gz";
$h = fopen($f,'r');
var_dump(stream_get_meta_data($h));
gzclose($h);