1--TEST--
2Test ftp_ssl_connect() function : error conditions
3--EXTENSIONS--
4ftp
5pcntl
6openssl
7--SKIPIF--
8<?php
9if (!function_exists("ftp_ssl_connect")) die("skip ftp_ssl is disabled");
10?>
11--FILE--
12<?php
13echo "*** Testing ftp_ssl_connect() function : error conditions ***\n";
14echo "\n-- Testing ftp_ssl_connect() function on failure --\n";
15var_dump(ftp_ssl_connect('totes.invalid'));
16
17echo "\n-- Testing ftp_ssl_connect() function timeout exception for value 0 --\n";
18try {
19    ftp_ssl_connect('totes.invalid', 21, 0);
20} catch (ValueError $exception) {
21    echo $exception->getMessage() . "\n";
22}
23
24echo "===DONE===\n";
25--EXPECTF--
26*** Testing ftp_ssl_connect() function : error conditions ***
27
28-- Testing ftp_ssl_connect() function on failure --
29
30Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo for %s failed: %s in %s on line %d
31bool(false)
32
33-- Testing ftp_ssl_connect() function timeout exception for value 0 --
34ftp_ssl_connect(): Argument #3 ($timeout) must be greater than 0
35===DONE===
36