xref: /PHP-7.1/ext/ftp/tests/004.phpt (revision e5eb9530)
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_get($ftp, 1234,12));
24var_dump(ftp_close());
25var_dump(ftp_connect('sfjkfjaksfjkasjf'));
26var_dump(ftp_delete($ftp, array()));
27var_dump(ftp_exec($ftp, array()));
28
29var_dump(ftp_systype($ftp, 0));
30var_dump(ftp_pwd($ftp, array()));
31
32var_dump(ftp_login($ftp));
33var_dump(ftp_login($ftp, 'user', 'bogus'));
34
35var_dump(ftp_quit($ftp));
36?>
37--EXPECTF--
38bool(true)
39string(4) "UNIX"
40
41Warning: ftp_alloc() expects parameter 2 to be integer, array given in %s004.php on line 12
42bool(false)
43
44Warning: ftp_cdup() expects exactly 1 parameter, 2 given in %s004.php on line 13
45NULL
46
47Warning: ftp_chdir() expects parameter 2 to be string, array given in %s004.php on line 14
48NULL
49
50Warning: ftp_chmod() expects exactly 3 parameters, 2 given in %s on line %d
51bool(false)
52
53Warning: ftp_get() expects at least 4 parameters, 3 given in %s on line %d
54NULL
55
56Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 17
57NULL
58
59Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 18
60bool(false)
61
62Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 19
63NULL
64
65Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 20
66NULL
67
68Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 22
69NULL
70
71Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 23
72NULL
73
74Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 25
75NULL
76
77Warning: ftp_login(): Not logged in. in %s004.php on line 26
78bool(false)
79bool(true)
80