Skip to content

Commit 01edef7

Browse files
committed
ftp test fixes
1 parent f40459c commit 01edef7

File tree

4 files changed

+6
-186
lines changed

4 files changed

+6
-186
lines changed

ext/ftp/tests/004.phpt

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,68 +8,22 @@ require 'skipif.inc';
88
<?php
99
require 'server.inc';
1010

11+
// Negative timeout
12+
var_dump(ftp_connect('127.0.0.1', 0, -3));
13+
1114
$ftp = ftp_connect('127.0.0.1', $port);
1215
if (!$ftp) die("Couldn't connect to the server");
1316

1417
var_dump(ftp_login($ftp, 'user', 'pass'));
15-
16-
var_dump(ftp_systype($ftp));
17-
18-
/* some bogus usage */
19-
var_dump(ftp_alloc($ftp, array()));
20-
var_dump(ftp_cdup($ftp, 0));
21-
var_dump(ftp_chdir($ftp, array()));
22-
var_dump(ftp_chmod($ftp, 0666));
23-
var_dump(ftp_close());
24-
var_dump(ftp_connect('sfjkfjaksfjkasjf'));
25-
var_dump(ftp_delete($ftp, array()));
26-
var_dump(ftp_exec($ftp, array()));
27-
28-
var_dump(ftp_systype($ftp, 0));
29-
var_dump(ftp_pwd($ftp, array()));
30-
31-
var_dump(ftp_login($ftp));
3218
var_dump(ftp_login($ftp, 'user', 'bogus'));
3319

3420
var_dump(ftp_quit($ftp));
3521
?>
3622
--EXPECTF--
37-
bool(true)
38-
string(4) "UNIX"
39-
40-
Warning: ftp_alloc() expects parameter 2 to be int, array given in %s004.php on line 12
41-
bool(false)
42-
43-
Warning: ftp_cdup() expects exactly 1 parameter, 2 given in %s004.php on line 13
44-
NULL
45-
46-
Warning: ftp_chdir() expects parameter 2 to be string, array given in %s004.php on line 14
47-
NULL
48-
49-
Warning: ftp_chmod() expects exactly 3 parameters, 2 given in %s on line %d
23+
Warning: ftp_connect(): Timeout has to be greater than 0 in %s on line %d
5024
bool(false)
25+
bool(true)
5126

52-
Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 16
53-
NULL
54-
55-
Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 17
56-
bool(false)
57-
58-
Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 18
59-
NULL
60-
61-
Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 19
62-
NULL
63-
64-
Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 21
65-
NULL
66-
67-
Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 22
68-
NULL
69-
70-
Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 24
71-
NULL
72-
73-
Warning: ftp_login(): Not logged in. in %s004.php on line 25
27+
Warning: ftp_login(): Not logged in. in %s on line %d
7428
bool(false)
7529
bool(true)

ext/ftp/tests/006.phpt

Lines changed: 0 additions & 108 deletions
This file was deleted.

ext/ftp/tests/ftp_get_basic.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ unlink($tmpfname);
2929

3030
//test non-existent file request
3131
ftp_get($ftp, $tmpfname ,'a warning.txt', FTP_ASCII);
32-
33-
//test invalid ftp_get params
34-
var_dump(ftp_get('foo', 'bar', 'baz'));
3532
?>
3633
--EXPECTF--
3734
bool(true)
@@ -41,6 +38,3 @@ bool(true)
4138
string(21) "BINARYFoo%00Bar%0D%0A"
4239

4340
Warning: ftp_get(): a warning: No such file or directory in %sftp_get_basic.php on line %d
44-
45-
Warning: ftp_get() expects parameter 1 to be resource, string given in %s on line %d
46-
NULL

ext/ftp/tests/ftp_ssl_connect_error.phpt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ echo "*** Testing ftp_ssl_connect() function : error conditions ***\n";
1212
echo "\n-- Testing ftp_ssl_connect() function on failure --\n";
1313
var_dump(ftp_ssl_connect('totes.invalid'));
1414

15-
echo "\n-- Testing ftp_ssl_connect() function invalid argument type --\n";
16-
ftp_ssl_connect([]);
17-
ftp_ssl_connect('totes.invalid', []);
18-
ftp_ssl_connect('totes.invalid', 21, []);
19-
20-
echo "\n-- Testing ftp_ssl_connect() function with more than expected no. of arguments --\n";
21-
ftp_ssl_connect('totes.invalid', 21, 1, []);
22-
2315
echo "\n-- Testing ftp_ssl_connect() function timeout warning for value 0 --\n";
2416
ftp_ssl_connect('totes.invalid', 21, 0);
2517

@@ -32,18 +24,6 @@ echo "===DONE===\n";
3224
Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s on line %d
3325
bool(false)
3426

35-
-- Testing ftp_ssl_connect() function invalid argument type --
36-
37-
Warning: ftp_ssl_connect() expects parameter 1 to be string, array given in %s on line %d
38-
39-
Warning: ftp_ssl_connect() expects parameter 2 to be int, array given in %s on line %d
40-
41-
Warning: ftp_ssl_connect() expects parameter 3 to be int, array given in %s on line %d
42-
43-
-- Testing ftp_ssl_connect() function with more than expected no. of arguments --
44-
45-
Warning: ftp_ssl_connect() expects at most 3 parameters, 4 given in %s on line %d
46-
4727
-- Testing ftp_ssl_connect() function timeout warning for value 0 --
4828

4929
Warning: ftp_ssl_connect(): Timeout has to be greater than 0 in %s on line %d

0 commit comments

Comments
 (0)