xref: /PHP-7.3/ext/ftp/tests/004.phpt (revision ce1d69a1)
1--TEST--
2FTP with bogus parameters
3--SKIPIF--
4<?php
5require 'skipif.inc';
6?>
7--FILE--
8<?php
9require 'server.inc';
10
11$ftp = ftp_connect('127.0.0.1', $port);
12if (!$ftp) die("Couldn't connect to the server");
13
14var_dump(ftp_login($ftp, 'user', 'pass'));
15
16var_dump(ftp_systype($ftp));
17
18/* some bogus usage */
19var_dump(ftp_alloc($ftp, array()));
20var_dump(ftp_cdup($ftp, 0));
21var_dump(ftp_chdir($ftp, array()));
22var_dump(ftp_chmod($ftp, 0666));
23var_dump(ftp_close());
24var_dump(ftp_connect('sfjkfjaksfjkasjf'));
25var_dump(ftp_delete($ftp, array()));
26var_dump(ftp_exec($ftp, array()));
27
28var_dump(ftp_systype($ftp, 0));
29var_dump(ftp_pwd($ftp, array()));
30
31var_dump(ftp_login($ftp));
32var_dump(ftp_login($ftp, 'user', 'bogus'));
33
34var_dump(ftp_quit($ftp));
35?>
36--EXPECTF--
37bool(true)
38string(4) "UNIX"
39
40Warning: ftp_alloc() expects parameter 2 to be int, array given in %s004.php on line 12
41bool(false)
42
43Warning: ftp_cdup() expects exactly 1 parameter, 2 given in %s004.php on line 13
44NULL
45
46Warning: ftp_chdir() expects parameter 2 to be string, array given in %s004.php on line 14
47NULL
48
49Warning: ftp_chmod() expects exactly 3 parameters, 2 given in %s on line %d
50bool(false)
51
52Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 16
53NULL
54
55Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 17
56bool(false)
57
58Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 18
59NULL
60
61Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 19
62NULL
63
64Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 21
65NULL
66
67Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 22
68NULL
69
70Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 24
71NULL
72
73Warning: ftp_login(): Not logged in. in %s004.php on line 25
74bool(false)
75bool(true)
76