summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cgi/tests/002.phpt2
-rw-r--r--sapi/cgi/tests/003.phpt2
-rw-r--r--sapi/cgi/tests/004.phpt2
-rw-r--r--sapi/cgi/tests/006.phpt2
-rw-r--r--sapi/cgi/tests/008.phpt2
-rw-r--r--sapi/cgi/tests/apache_request_headers.phpt2
-rw-r--r--sapi/cgi/tests/apache_response_headers.phpt4
-rw-r--r--sapi/cgi/tests/bug75574_utf8.phpt2
-rw-r--r--sapi/cli/tests/007.phpt2
-rw-r--r--sapi/cli/tests/008.phpt2
-rw-r--r--sapi/cli/tests/010-2.phpt2
-rw-r--r--sapi/cli/tests/011.phpt2
-rw-r--r--sapi/cli/tests/013.phpt2
-rw-r--r--sapi/cli/tests/014.phpt2
-rw-r--r--sapi/cli/tests/022.phpt2
-rw-r--r--sapi/cli/tests/argv_mb.phpt2
-rw-r--r--sapi/cli/tests/argv_mb_bug77111.phpt8
-rw-r--r--sapi/cli/tests/bug71624.phpt2
-rw-r--r--sapi/cli/tests/php_cli_server_015.phpt2
19 files changed, 23 insertions, 23 deletions
diff --git a/sapi/cgi/tests/002.phpt b/sapi/cgi/tests/002.phpt
index 91db184fcb..b28c865659 100644
--- a/sapi/cgi/tests/002.phpt
+++ b/sapi/cgi/tests/002.phpt
@@ -11,7 +11,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$file = dirname(__FILE__)."/002.test.php";
+$file = __DIR__."/002.test.php";
file_put_contents($file, '<?php var_dump(ini_get("max_execution_time")); ?>');
diff --git a/sapi/cgi/tests/003.phpt b/sapi/cgi/tests/003.phpt
index a4d3058624..4b4d29267d 100644
--- a/sapi/cgi/tests/003.phpt
+++ b/sapi/cgi/tests/003.phpt
@@ -17,7 +17,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$filename = dirname(__FILE__).'/003.test.php';
+$filename = __DIR__.'/003.test.php';
$code ='
<?php
/* some test script */
diff --git a/sapi/cgi/tests/004.phpt b/sapi/cgi/tests/004.phpt
index c41df11acc..b46dce7052 100644
--- a/sapi/cgi/tests/004.phpt
+++ b/sapi/cgi/tests/004.phpt
@@ -12,7 +12,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$filename = dirname(__FILE__).'/004.test.php';
+$filename = __DIR__.'/004.test.php';
$code ='
<?php
diff --git a/sapi/cgi/tests/006.phpt b/sapi/cgi/tests/006.phpt
index bc98656b49..c78229880c 100644
--- a/sapi/cgi/tests/006.phpt
+++ b/sapi/cgi/tests/006.phpt
@@ -11,7 +11,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$filename = dirname(__FILE__)."/006.test.php";
+$filename = __DIR__."/006.test.php";
$code = '
<?php
diff --git a/sapi/cgi/tests/008.phpt b/sapi/cgi/tests/008.phpt
index f0df0bae42..be2fd578e7 100644
--- a/sapi/cgi/tests/008.phpt
+++ b/sapi/cgi/tests/008.phpt
@@ -10,7 +10,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$filename = dirname(__FILE__)."/008.test.php";
+$filename = __DIR__."/008.test.php";
$code = '
<?php
$test = "var"; //var
diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt
index 3750600671..bda9ef8b70 100644
--- a/sapi/cgi/tests/apache_request_headers.phpt
+++ b/sapi/cgi/tests/apache_request_headers.phpt
@@ -13,7 +13,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$file = dirname(__FILE__)."/012.test.php";
+$file = __DIR__."/012.test.php";
file_put_contents($file, '<?php print_r(apache_request_headers()); ?>');
diff --git a/sapi/cgi/tests/apache_response_headers.phpt b/sapi/cgi/tests/apache_response_headers.phpt
index 2964ac7bc7..99b1352680 100644
--- a/sapi/cgi/tests/apache_response_headers.phpt
+++ b/sapi/cgi/tests/apache_response_headers.phpt
@@ -11,7 +11,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$test_file = dirname(__FILE__) . DIRECTORY_SEPARATOR ."apache_response_headers.test.php";
+$test_file = __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php";
$code = '<?php';
$code .= '
@@ -34,7 +34,7 @@ passthru( "$php -n -q " . escapeshellarg( $test_file ) );
===DONE===
--CLEAN--
<?php
-@unlink( dirname(__FILE__) . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" );
+@unlink( __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" );
?>
--EXPECTF--
array(3) {
diff --git a/sapi/cgi/tests/bug75574_utf8.phpt b/sapi/cgi/tests/bug75574_utf8.phpt
index 650d4a75f1..d7f0e3e5ee 100644
--- a/sapi/cgi/tests/bug75574_utf8.phpt
+++ b/sapi/cgi/tests/bug75574_utf8.phpt
@@ -16,7 +16,7 @@ include "include.inc";
$php = get_cgi_path();
reset_env_vars();
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . md5(uniqid());
+$fn = __DIR__ . DIRECTORY_SEPARATOR . md5(uniqid());
file_put_contents($fn, "<?php\nvar_dump(putenv('FOO=啊'));\n//var_dump(`echo %FOO%`);\nvar_dump(getenv('FOO'));");
echo shell_exec("$php -n -f $fn");
diff --git a/sapi/cli/tests/007.phpt b/sapi/cli/tests/007.phpt
index dd8e17163c..51858bae48 100644
--- a/sapi/cli/tests/007.phpt
+++ b/sapi/cli/tests/007.phpt
@@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename = dirname(__FILE__).'/007.test.php';
+$filename = __DIR__.'/007.test.php';
$code ='
<?php
/* some test script */
diff --git a/sapi/cli/tests/008.phpt b/sapi/cli/tests/008.phpt
index d795c98879..fb8518535a 100644
--- a/sapi/cli/tests/008.phpt
+++ b/sapi/cli/tests/008.phpt
@@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename = dirname(__FILE__).'/008.test.php';
+$filename = __DIR__.'/008.test.php';
$code ='
<?php
diff --git a/sapi/cli/tests/010-2.phpt b/sapi/cli/tests/010-2.phpt
index 73198ad28b..af998351bb 100644
--- a/sapi/cli/tests/010-2.phpt
+++ b/sapi/cli/tests/010-2.phpt
@@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename_txt = dirname(__FILE__)."/010.test.txt";
+$filename_txt = __DIR__."/010.test.txt";
$txt = '
test
diff --git a/sapi/cli/tests/011.phpt b/sapi/cli/tests/011.phpt
index 1fbe93d703..3ada7c53bf 100644
--- a/sapi/cli/tests/011.phpt
+++ b/sapi/cli/tests/011.phpt
@@ -7,7 +7,7 @@ syntax check
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename = dirname(__FILE__)."/011.test.php";
+$filename = __DIR__."/011.test.php";
$code = '
<?php
diff --git a/sapi/cli/tests/013.phpt b/sapi/cli/tests/013.phpt
index 9e17c009c2..3ca2ba833c 100644
--- a/sapi/cli/tests/013.phpt
+++ b/sapi/cli/tests/013.phpt
@@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename_txt = dirname(__FILE__)."/013.test.txt";
+$filename_txt = __DIR__."/013.test.txt";
file_put_contents($filename_txt, "test\nfile\ncontents\n");
var_dump(`cat "$filename_txt" | "$php" -n -B 'var_dump("start");'`);
diff --git a/sapi/cli/tests/014.phpt b/sapi/cli/tests/014.phpt
index 1794d78b54..1ee72e05f6 100644
--- a/sapi/cli/tests/014.phpt
+++ b/sapi/cli/tests/014.phpt
@@ -7,7 +7,7 @@ syntax highlighting
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename = dirname(__FILE__)."/014.test.php";
+$filename = __DIR__."/014.test.php";
$code = '
<?php
$test = "var"; //var
diff --git a/sapi/cli/tests/022.phpt b/sapi/cli/tests/022.phpt
index 0110220bee..3b97016b58 100644
--- a/sapi/cli/tests/022.phpt
+++ b/sapi/cli/tests/022.phpt
@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test");
<?php
$php = getenv("TEST_PHP_EXECUTABLE");
$socket_file = tempnam(sys_get_temp_dir(), pathinfo(__FILE__, PATHINFO_FILENAME) . '.sock');
-$test_file = dirname(__FILE__) . '/' . pathinfo(__FILE__, PATHINFO_FILENAME) . '.inc';
+$test_file = __DIR__ . '/' . pathinfo(__FILE__, PATHINFO_FILENAME) . '.inc';
if (file_exists($socket_file)) {
unlink($socket_file);
}
diff --git a/sapi/cli/tests/argv_mb.phpt b/sapi/cli/tests/argv_mb.phpt
index 3b7c6eac19..868b1a857f 100644
--- a/sapi/cli/tests/argv_mb.phpt
+++ b/sapi/cli/tests/argv_mb.phpt
@@ -9,7 +9,7 @@ include "skipif.inc";
$php = getenv('TEST_PHP_EXECUTABLE');
-$argv_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "argv_test.php";
+$argv_fl = __DIR__ . DIRECTORY_SEPARATOR . "argv_test.php";
file_put_contents($argv_fl, "<?php var_dump(\$argv); ?>");
var_dump(`$php -n $argv_fl 多字节字符串 マルチバイト文字列 многобайтоваястрока flerbytesträng`);
diff --git a/sapi/cli/tests/argv_mb_bug77111.phpt b/sapi/cli/tests/argv_mb_bug77111.phpt
index e21cc07678..45913b841f 100644
--- a/sapi/cli/tests/argv_mb_bug77111.phpt
+++ b/sapi/cli/tests/argv_mb_bug77111.phpt
@@ -19,9 +19,9 @@ if (!file_exists($php)) {
$php = dirname(getenv('TEST_PHP_EXECUTABLE')) . DIRECTORY_SEPARATOR . "php-win.exe";
-$out_fl = dirname(__FILE__) . "\\argv_bug77111.txt";
+$out_fl = __DIR__ . "\\argv_bug77111.txt";
-$argv_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "argv_test.php";
+$argv_fl = __DIR__ . DIRECTORY_SEPARATOR . "argv_test.php";
file_put_contents($argv_fl, "<?php file_put_contents('$out_fl', implode(' ', array_slice(\$argv, 1))); ?>");
`$php -n $argv_fl Ästhetik Æstetik Esthétique Estética Эстетика`;
@@ -31,8 +31,8 @@ var_dump(file_get_contents($out_fl));
==DONE==
--CLEAN--
<?php
-$out_fl = dirname(__FILE__) . "\\argv_bug77111.txt";
-$argv_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "argv_test.php";
+$out_fl = __DIR__ . "\\argv_bug77111.txt";
+$argv_fl = __DIR__ . DIRECTORY_SEPARATOR . "argv_test.php";
unlink($argv_fl);
unlink($out_fl);
?>
diff --git a/sapi/cli/tests/bug71624.phpt b/sapi/cli/tests/bug71624.phpt
index aa4c69da12..67e3e8f343 100644
--- a/sapi/cli/tests/bug71624.phpt
+++ b/sapi/cli/tests/bug71624.phpt
@@ -9,7 +9,7 @@ include "skipif.inc";
$php = getenv('TEST_PHP_EXECUTABLE');
-$filename_txt = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug71624.test.txt";
+$filename_txt = __DIR__ . DIRECTORY_SEPARATOR . "bug71624.test.txt";
$txt = 'foo
test
diff --git a/sapi/cli/tests/php_cli_server_015.phpt b/sapi/cli/tests/php_cli_server_015.phpt
index 42000adbb9..990a3db97e 100644
--- a/sapi/cli/tests/php_cli_server_015.phpt
+++ b/sapi/cli/tests/php_cli_server_015.phpt
@@ -10,7 +10,7 @@ display_errors=1
<?php
include "php_cli_server.inc";
php_cli_server_start('require("syntax_error.php");');
-$dir = realpath(dirname(__FILE__));
+$dir = realpath(__DIR__);
file_put_contents($dir . "/syntax_error.php", "<?php non_exists_function(); ?>");