1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 21:11:02 +02:00
Files
archived-php-src/ext/ftp/tests/006.phpt
Peter Kokot d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00

109 lines
2.9 KiB
PHP

--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