summaryrefslogtreecommitdiff
path: root/ext/ftp/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-19 17:11:00 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-11 11:32:20 +0100
commit852485d8ecd784153e41e565a0a87abf99cf4e0d (patch)
tree3c8be88c2c98b5f1b2f9ea51e5d3a20c10baf3ff /ext/ftp/tests
parent6bfb119e18e5241b6719a4ad69223d91c465a58e (diff)
downloadphp-git-852485d8ecd784153e41e565a0a87abf99cf4e0d.tar.gz
Adjust tests for zpp TypeError change
Diffstat (limited to 'ext/ftp/tests')
-rw-r--r--ext/ftp/tests/004.phpt58
-rw-r--r--ext/ftp/tests/006.phpt108
-rw-r--r--ext/ftp/tests/ftp_get_basic.phpt6
-rw-r--r--ext/ftp/tests/ftp_ssl_connect_error.phpt20
4 files changed, 6 insertions, 186 deletions
diff --git a/ext/ftp/tests/004.phpt b/ext/ftp/tests/004.phpt
index 3fcf272e3b..b95c12c518 100644
--- a/ext/ftp/tests/004.phpt
+++ b/ext/ftp/tests/004.phpt
@@ -8,68 +8,22 @@ require 'skipif.inc';
<?php
require 'server.inc';
+// Negative timeout
+var_dump(ftp_connect('127.0.0.1', 0, -3));
+
$ftp = ftp_connect('127.0.0.1', $port);
if (!$ftp) die("Couldn't connect to the server");
var_dump(ftp_login($ftp, 'user', 'pass'));
-
-var_dump(ftp_systype($ftp));
-
-/* some bogus usage */
-var_dump(ftp_alloc($ftp, array()));
-var_dump(ftp_cdup($ftp, 0));
-var_dump(ftp_chdir($ftp, array()));
-var_dump(ftp_chmod($ftp, 0666));
-var_dump(ftp_close());
-var_dump(ftp_connect('sfjkfjaksfjkasjf'));
-var_dump(ftp_delete($ftp, array()));
-var_dump(ftp_exec($ftp, array()));
-
-var_dump(ftp_systype($ftp, 0));
-var_dump(ftp_pwd($ftp, array()));
-
-var_dump(ftp_login($ftp));
var_dump(ftp_login($ftp, 'user', 'bogus'));
var_dump(ftp_quit($ftp));
?>
--EXPECTF--
-bool(true)
-string(4) "UNIX"
-
-Warning: ftp_alloc() expects parameter 2 to be int, array given in %s004.php on line 12
-bool(false)
-
-Warning: ftp_cdup() expects exactly 1 parameter, 2 given in %s004.php on line 13
-NULL
-
-Warning: ftp_chdir() expects parameter 2 to be string, array given in %s004.php on line 14
-NULL
-
-Warning: ftp_chmod() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ftp_connect(): Timeout has to be greater than 0 in %s on line %d
bool(false)
+bool(true)
-Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 16
-NULL
-
-Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 17
-bool(false)
-
-Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 18
-NULL
-
-Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 19
-NULL
-
-Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 21
-NULL
-
-Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 22
-NULL
-
-Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 24
-NULL
-
-Warning: ftp_login(): Not logged in. in %s004.php on line 25
+Warning: ftp_login(): Not logged in. in %s on line %d
bool(false)
bool(true)
diff --git a/ext/ftp/tests/006.phpt b/ext/ftp/tests/006.phpt
deleted file mode 100644
index ff0d258917..0000000000
--- a/ext/ftp/tests/006.phpt
+++ /dev/null
@@ -1,108 +0,0 @@
---TEST--
-FTP with bogus parameters
---SKIPIF--
-<?php
-require 'skipif.inc';
-?>
---FILE--
-<?php
-$ftp=null;
-
-var_dump(ftp_connect(array()));
-var_dump(ftp_connect('127.0.0.1', 0, -3));
-var_dump(ftp_raw($ftp));
-var_dump(ftp_mkdir($ftp));
-var_dump(ftp_rmdir($ftp));
-var_dump(ftp_nlist($ftp));
-var_dump(ftp_rawlist($ftp));
-var_dump(ftp_fget($ftp));
-var_dump(ftp_nb_fget($ftp));
-var_dump(ftp_nb_get($ftp));
-var_dump(ftp_pasv($ftp));
-var_dump(ftp_nb_continue());
-var_dump(ftp_fput());
-var_dump(ftp_nb_fput($ftp));
-var_dump(ftp_put($ftp));
-var_dump(ftp_nb_put($ftp));
-var_dump(ftp_size($ftp));
-var_dump(ftp_mdtm($ftp));
-var_dump(ftp_rename($ftp));
-var_dump(ftp_site($ftp));
-var_dump(ftp_set_option($ftp));
-var_dump(ftp_get_option($ftp));
-var_dump(ftp_mlsd($ftp));
-var_dump(ftp_append($ftp));
-
-?>
---EXPECTF--
-Warning: ftp_connect() expects parameter 1 to be string, array given in %s006.php on line 4
-NULL
-
-Warning: ftp_connect(): Timeout has to be greater than 0 in %s006.php on line 5
-bool(false)
-
-Warning: ftp_raw() expects exactly 2 parameters, 1 given in %s006.php on line 6
-NULL
-
-Warning: ftp_mkdir() expects exactly 2 parameters, 1 given in %s006.php on line 7
-NULL
-
-Warning: ftp_rmdir() expects exactly 2 parameters, 1 given in %s006.php on line 8
-NULL
-
-Warning: ftp_nlist() expects exactly 2 parameters, 1 given in %s006.php on line 9
-NULL
-
-Warning: ftp_rawlist() expects at least 2 parameters, 1 given in %s006.php on line 10
-NULL
-
-Warning: ftp_fget() expects at least 3 parameters, 1 given in %s006.php on line 11
-NULL
-
-Warning: ftp_nb_fget() expects at least 3 parameters, 1 given in %s006.php on line 12
-NULL
-
-Warning: ftp_nb_get() expects at least 3 parameters, 1 given in %s006.php on line 13
-NULL
-
-Warning: ftp_pasv() expects exactly 2 parameters, 1 given in %s006.php on line 14
-NULL
-
-Warning: ftp_nb_continue() expects exactly 1 parameter, 0 given in %s006.php on line 15
-NULL
-
-Warning: ftp_fput() expects at least 3 parameters, 0 given in %s006.php on line 16
-NULL
-
-Warning: ftp_nb_fput() expects at least 3 parameters, 1 given in %s006.php on line 17
-NULL
-
-Warning: ftp_put() expects at least 3 parameters, 1 given in %s006.php on line 18
-NULL
-
-Warning: ftp_nb_put() expects at least 3 parameters, 1 given in %s006.php on line 19
-NULL
-
-Warning: ftp_size() expects exactly 2 parameters, 1 given in %s006.php on line 20
-NULL
-
-Warning: ftp_mdtm() expects exactly 2 parameters, 1 given in %s006.php on line 21
-NULL
-
-Warning: ftp_rename() expects exactly 3 parameters, 1 given in %s006.php on line 22
-NULL
-
-Warning: ftp_site() expects exactly 2 parameters, 1 given in %s006.php on line 23
-NULL
-
-Warning: ftp_set_option() expects exactly 3 parameters, 1 given in %s006.php on line 24
-NULL
-
-Warning: ftp_get_option() expects exactly 2 parameters, 1 given in %s006.php on line 25
-NULL
-
-Warning: ftp_mlsd() expects exactly 2 parameters, 1 given in %s006.php on line 26
-NULL
-
-Warning: ftp_append() expects at least 3 parameters, 1 given in %s006.php on line 27
-NULL
diff --git a/ext/ftp/tests/ftp_get_basic.phpt b/ext/ftp/tests/ftp_get_basic.phpt
index 60f1b1de79..43022cde45 100644
--- a/ext/ftp/tests/ftp_get_basic.phpt
+++ b/ext/ftp/tests/ftp_get_basic.phpt
@@ -29,9 +29,6 @@ unlink($tmpfname);
//test non-existent file request
ftp_get($ftp, $tmpfname ,'a warning.txt', FTP_ASCII);
-
-//test invalid ftp_get params
-var_dump(ftp_get('foo', 'bar', 'baz'));
?>
--EXPECTF--
bool(true)
@@ -41,6 +38,3 @@ bool(true)
string(21) "BINARYFoo%00Bar%0D%0A"
Warning: ftp_get(): a warning: No such file or directory in %sftp_get_basic.php on line %d
-
-Warning: ftp_get() expects parameter 1 to be resource, string given in %s on line %d
-NULL
diff --git a/ext/ftp/tests/ftp_ssl_connect_error.phpt b/ext/ftp/tests/ftp_ssl_connect_error.phpt
index b0ece5d63b..13c8f9e9c0 100644
--- a/ext/ftp/tests/ftp_ssl_connect_error.phpt
+++ b/ext/ftp/tests/ftp_ssl_connect_error.phpt
@@ -12,14 +12,6 @@ echo "*** Testing ftp_ssl_connect() function : error conditions ***\n";
echo "\n-- Testing ftp_ssl_connect() function on failure --\n";
var_dump(ftp_ssl_connect('totes.invalid'));
-echo "\n-- Testing ftp_ssl_connect() function invalid argument type --\n";
-ftp_ssl_connect([]);
-ftp_ssl_connect('totes.invalid', []);
-ftp_ssl_connect('totes.invalid', 21, []);
-
-echo "\n-- Testing ftp_ssl_connect() function with more than expected no. of arguments --\n";
-ftp_ssl_connect('totes.invalid', 21, 1, []);
-
echo "\n-- Testing ftp_ssl_connect() function timeout warning for value 0 --\n";
ftp_ssl_connect('totes.invalid', 21, 0);
@@ -32,18 +24,6 @@ echo "===DONE===\n";
Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s on line %d
bool(false)
--- Testing ftp_ssl_connect() function invalid argument type --
-
-Warning: ftp_ssl_connect() expects parameter 1 to be string, array given in %s on line %d
-
-Warning: ftp_ssl_connect() expects parameter 2 to be int, array given in %s on line %d
-
-Warning: ftp_ssl_connect() expects parameter 3 to be int, array given in %s on line %d
-
--- Testing ftp_ssl_connect() function with more than expected no. of arguments --
-
-Warning: ftp_ssl_connect() expects at most 3 parameters, 4 given in %s on line %d
-
-- Testing ftp_ssl_connect() function timeout warning for value 0 --
Warning: ftp_ssl_connect(): Timeout has to be greater than 0 in %s on line %d