summaryrefslogtreecommitdiff
path: root/ext/ftp
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/ftp
parent63802a8446691869371bb37078d55b99cae7eb95 (diff)
downloadphp-git-26dfce7f36d1c6f737ac241df1315a1b42b932c7.tar.gz
Replace dirname(__FILE__) by __DIR__ in tests
Diffstat (limited to 'ext/ftp')
-rw-r--r--ext/ftp/tests/ftp_fget_basic1.phpt4
-rw-r--r--ext/ftp/tests/ftp_fget_basic2.phpt4
-rw-r--r--ext/ftp/tests/ftp_fget_basic3.phpt4
-rw-r--r--ext/ftp/tests/ftp_get_basic.phpt4
-rw-r--r--ext/ftp/tests/ftp_nb_continue.phpt4
-rw-r--r--ext/ftp/tests/ftp_nb_fget_basic1.phpt4
-rw-r--r--ext/ftp/tests/ftp_nb_fget_basic2.phpt4
-rw-r--r--ext/ftp/tests/ftp_nb_fget_basic3.phpt4
-rw-r--r--ext/ftp/tests/ftp_nb_get_large.phpt4
9 files changed, 18 insertions, 18 deletions
diff --git a/ext/ftp/tests/ftp_fget_basic1.phpt b/ext/ftp/tests/ftp_fget_basic1.phpt
index 5909d35cef..d104a3a0c5 100644
--- a/ext/ftp/tests/ftp_fget_basic1.phpt
+++ b/ext/ftp/tests/ftp_fget_basic1.phpt
@@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
ftp_set_option($ftp, FTP_AUTOSEEK, false);
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt";
$handle = fopen($local_file, 'w');
var_dump(ftp_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME));
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt");
?>
--EXPECT--
bool(true)
diff --git a/ext/ftp/tests/ftp_fget_basic2.phpt b/ext/ftp/tests/ftp_fget_basic2.phpt
index 622cea3683..39a9ce8f0c 100644
--- a/ext/ftp/tests/ftp_fget_basic2.phpt
+++ b/ext/ftp/tests/ftp_fget_basic2.phpt
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt";
file_put_contents($local_file, 'ASCIIFoo');
$handle = fopen($local_file, 'a');
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt");
?>
--EXPECT--
bool(true)
diff --git a/ext/ftp/tests/ftp_fget_basic3.phpt b/ext/ftp/tests/ftp_fget_basic3.phpt
index 9485473b1c..88119b61f7 100644
--- a/ext/ftp/tests/ftp_fget_basic3.phpt
+++ b/ext/ftp/tests/ftp_fget_basic3.phpt
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt";
file_put_contents($local_file, 'ASCIIFoo');
$handle = fopen($local_file, 'a');
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt");
?>
--EXPECT--
bool(true)
diff --git a/ext/ftp/tests/ftp_get_basic.phpt b/ext/ftp/tests/ftp_get_basic.phpt
index 60f1b1de79..2c5f6f58a6 100644
--- a/ext/ftp/tests/ftp_get_basic.phpt
+++ b/ext/ftp/tests/ftp_get_basic.phpt
@@ -16,13 +16,13 @@ if (!$ftp) die("Couldn't connect to the server");
var_dump(ftp_login($ftp, 'user', 'pass'));
//test simple text transfer
-$tmpfname = tempnam(dirname(__FILE__), "ftp_test");
+$tmpfname = tempnam(__DIR__, "ftp_test");
var_dump(ftp_get($ftp, $tmpfname ,'a story.txt', FTP_ASCII));
echo file_get_contents($tmpfname);
unlink($tmpfname);
//test binary data transfer
-$tmpfname = tempnam(dirname(__FILE__), "ftp_test");
+$tmpfname = tempnam(__DIR__, "ftp_test");
var_dump(ftp_get($ftp, $tmpfname, 'binary data.bin', FTP_BINARY));
var_dump(urlencode(file_get_contents($tmpfname)));
unlink($tmpfname);
diff --git a/ext/ftp/tests/ftp_nb_continue.phpt b/ext/ftp/tests/ftp_nb_continue.phpt
index 1f70339913..1275897919 100644
--- a/ext/ftp/tests/ftp_nb_continue.phpt
+++ b/ext/ftp/tests/ftp_nb_continue.phpt
@@ -14,7 +14,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . $file;
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . $file;
touch($local_file);
$r = ftp_nb_get($ftp, $local_file, $file, FTP_BINARY);
@@ -27,7 +27,7 @@ echo file_get_contents($local_file);
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "mediumfile.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "mediumfile.txt");
?>
--EXPECT--
This is line 0 of the test data.
diff --git a/ext/ftp/tests/ftp_nb_fget_basic1.phpt b/ext/ftp/tests/ftp_nb_fget_basic1.phpt
index 5e6389ff13..d5576f3710 100644
--- a/ext/ftp/tests/ftp_nb_fget_basic1.phpt
+++ b/ext/ftp/tests/ftp_nb_fget_basic1.phpt
@@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
ftp_set_option($ftp, FTP_AUTOSEEK, false);
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt";
$handle = fopen($local_file, 'w');
var_dump(ftp_nb_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME));
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt");
?>
--EXPECT--
int(2)
diff --git a/ext/ftp/tests/ftp_nb_fget_basic2.phpt b/ext/ftp/tests/ftp_nb_fget_basic2.phpt
index 215b79ac4a..830e991c46 100644
--- a/ext/ftp/tests/ftp_nb_fget_basic2.phpt
+++ b/ext/ftp/tests/ftp_nb_fget_basic2.phpt
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt";
file_put_contents($local_file, 'ASCIIFoo');
$handle = fopen($local_file, 'a');
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt");
?>
--EXPECT--
int(2)
diff --git a/ext/ftp/tests/ftp_nb_fget_basic3.phpt b/ext/ftp/tests/ftp_nb_fget_basic3.phpt
index 66daf2ba0a..d62eb43644 100644
--- a/ext/ftp/tests/ftp_nb_fget_basic3.phpt
+++ b/ext/ftp/tests/ftp_nb_fget_basic3.phpt
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt";
file_put_contents($local_file, 'ASCIIFoo');
$handle = fopen($local_file, 'a');
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt");
?>
--EXPECT--
int(2)
diff --git a/ext/ftp/tests/ftp_nb_get_large.phpt b/ext/ftp/tests/ftp_nb_get_large.phpt
index 4ac5fa37f1..8163677a4e 100644
--- a/ext/ftp/tests/ftp_nb_get_large.phpt
+++ b/ext/ftp/tests/ftp_nb_get_large.phpt
@@ -18,7 +18,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
-$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt";
+$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt";
touch($local_file);
ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119);
$fp = fopen($local_file, 'r');
@@ -29,7 +29,7 @@ fclose($fp);
?>
--CLEAN--
<?php
-@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt");
+@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt");
?>
--EXPECT--
string(1) "X"