xref: /PHP-7.4/ext/ftp/tests/007.phpt (revision d679f022)
1--TEST--
2FTP with bogus resource
3--CREDITS--
4Michael Paul da Rosa <michael [at] michaelpaul [dot] com [dot] br>
5PHP TestFest Dublin 2017
6--SKIPIF--
7<?php
8require 'skipif.inc';
9?>
10--FILE--
11<?php
12$ftp = tmpfile();
13
14var_dump(ftp_login($ftp, 'user', 'pass'));
15var_dump(ftp_pwd($ftp));
16var_dump(ftp_cdup($ftp));
17var_dump(ftp_chdir($ftp, '~'));
18var_dump(ftp_exec($ftp, 'x'));
19var_dump(ftp_raw($ftp, 'x'));
20var_dump(ftp_mkdir($ftp, '/'));
21var_dump(ftp_rmdir($ftp, '/'));
22var_dump(ftp_chmod($ftp, 7777, '/'));
23var_dump(ftp_alloc($ftp, 7777));
24var_dump(ftp_nlist($ftp, '/'));
25var_dump(ftp_rawlist($ftp, '~'));
26var_dump(ftp_mlsd($ftp, '~'));
27var_dump(ftp_systype($ftp));
28var_dump(ftp_fget($ftp, $ftp, 'remote', 7777));
29var_dump(ftp_nb_fget($ftp, $ftp, 'remote', 7777));
30var_dump(ftp_pasv($ftp, false));
31var_dump(ftp_get($ftp, 'local', 'remote', 7777));
32var_dump(ftp_nb_get($ftp, 'local', 'remote', 7777));
33var_dump(ftp_nb_continue($ftp));
34var_dump(ftp_fput($ftp, 'remote', $ftp, 9999));
35var_dump(ftp_nb_fput($ftp, 'remote', $ftp, 9999));
36var_dump(ftp_put($ftp, 'remote', 'local', 9999));
37var_dump(ftp_append($ftp, 'remote', 'local', 9999));
38var_dump(ftp_nb_put($ftp, 'remote', 'local', 9999));
39var_dump(ftp_size($ftp, '~'));
40var_dump(ftp_mdtm($ftp, '~'));
41var_dump(ftp_rename($ftp, 'old', 'new'));
42var_dump(ftp_delete($ftp, 'gone'));
43var_dump(ftp_site($ftp, 'localhost'));
44var_dump(ftp_close($ftp));
45var_dump(ftp_set_option($ftp, 1, 2));
46var_dump(ftp_get_option($ftp, 1));
47
48fclose($ftp);
49?>
50--EXPECTF--
51Warning: ftp_login(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
52bool(false)
53
54Warning: ftp_pwd(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
55bool(false)
56
57Warning: ftp_cdup(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
58bool(false)
59
60Warning: ftp_chdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
61bool(false)
62
63Warning: ftp_exec(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
64bool(false)
65
66Warning: ftp_raw(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
67bool(false)
68
69Warning: ftp_mkdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
70bool(false)
71
72Warning: ftp_rmdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
73bool(false)
74
75Warning: ftp_chmod(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
76bool(false)
77
78Warning: ftp_alloc(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
79bool(false)
80
81Warning: ftp_nlist(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
82bool(false)
83
84Warning: ftp_rawlist(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
85bool(false)
86
87Warning: ftp_mlsd(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
88bool(false)
89
90Warning: ftp_systype(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
91bool(false)
92
93Warning: ftp_fget(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
94bool(false)
95
96Warning: ftp_nb_fget(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
97bool(false)
98
99Warning: ftp_pasv(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
100bool(false)
101
102Warning: ftp_get(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
103bool(false)
104
105Warning: ftp_nb_get(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
106bool(false)
107
108Warning: ftp_nb_continue(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
109bool(false)
110
111Warning: ftp_fput(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
112bool(false)
113
114Warning: ftp_nb_fput(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
115bool(false)
116
117Warning: ftp_put(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
118bool(false)
119
120Warning: ftp_append(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
121bool(false)
122
123Warning: ftp_nb_put(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
124bool(false)
125
126Warning: ftp_size(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
127bool(false)
128
129Warning: ftp_mdtm(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
130bool(false)
131
132Warning: ftp_rename(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
133bool(false)
134
135Warning: ftp_delete(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
136bool(false)
137
138Warning: ftp_site(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
139bool(false)
140
141Warning: ftp_close(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
142bool(false)
143
144Warning: ftp_set_option(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
145bool(false)
146
147Warning: ftp_get_option(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
148bool(false)
149