1--TEST-- 2Test ftp_ssl_connect() function : error conditions 3--SKIPIF-- 4<?php 5$ssl = 1; 6require 'skipif.inc'; 7if (!function_exists("ftp_ssl_connect")) die("skip ftp_ssl is disabled"); 8?> 9--FILE-- 10<?php 11echo "*** Testing ftp_ssl_connect() function : error conditions ***\n"; 12echo "\n-- Testing ftp_ssl_connect() function on failure --\n"; 13var_dump(ftp_ssl_connect('totes.invalid')); 14 15echo "\n-- Testing ftp_ssl_connect() function invalid argument type --\n"; 16ftp_ssl_connect([]); 17ftp_ssl_connect('totes.invalid', []); 18ftp_ssl_connect('totes.invalid', 21, []); 19 20echo "\n-- Testing ftp_ssl_connect() function with more than expected no. of arguments --\n"; 21ftp_ssl_connect('totes.invalid', 21, 1, []); 22 23echo "\n-- Testing ftp_ssl_connect() function timeout warning for value 0 --\n"; 24ftp_ssl_connect('totes.invalid', 21, 0); 25 26echo "===DONE===\n"; 27--EXPECTF-- 28*** Testing ftp_ssl_connect() function : error conditions *** 29 30-- Testing ftp_ssl_connect() function on failure -- 31 32Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in %s on line %d 33bool(false) 34 35-- Testing ftp_ssl_connect() function invalid argument type -- 36 37Warning: ftp_ssl_connect() expects parameter 1 to be string, array given in %s on line %d 38 39Warning: ftp_ssl_connect() expects parameter 2 to be integer, array given in %s on line %d 40 41Warning: ftp_ssl_connect() expects parameter 3 to be integer, array given in %s on line %d 42 43-- Testing ftp_ssl_connect() function with more than expected no. of arguments -- 44 45Warning: ftp_ssl_connect() expects at most 3 parameters, 4 given in %s on line %d 46 47-- Testing ftp_ssl_connect() function timeout warning for value 0 -- 48 49Warning: ftp_ssl_connect(): Timeout has to be greater than 0 in %s on line %d 50===DONE=== 51