From 9eaf2599d6a7244fc4059cb6fcc8476ca07a3b02 Mon Sep 17 00:00:00 2001 From: jcm Date: Wed, 13 Jul 2022 17:41:34 +0200 Subject: [PATCH 1/3] QA - ftp_connect - error behavior when connection fails --- ext/ftp/tests/ftp_connect_001.phpt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ext/ftp/tests/ftp_connect_001.phpt diff --git a/ext/ftp/tests/ftp_connect_001.phpt b/ext/ftp/tests/ftp_connect_001.phpt new file mode 100644 index 0000000000000..5a3f711174013 --- /dev/null +++ b/ext/ftp/tests/ftp_connect_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +ftp_connect - return FALSE if connection fails and Waning is generated +--EXTENSIONS-- +ftp +--INI-- +max_execution_time=2 +--FILE-- + +--EXPECTF-- +Warning: ftp_connect(): php_network_getaddresses: getaddrinfo for dummy-host-name failed: Temporary failure in name resolution %s +bool(false) From 64b70745ecd02ed2d8582bcf8aac0165416c6fcc Mon Sep 17 00:00:00 2001 From: Juan Morales Date: Wed, 13 Jul 2022 21:07:53 +0200 Subject: [PATCH 2/3] Adjust expected message Co-authored-by: Christoph M. Becker --- ext/ftp/tests/ftp_connect_001.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ftp/tests/ftp_connect_001.phpt b/ext/ftp/tests/ftp_connect_001.phpt index 5a3f711174013..9020461abf0ab 100644 --- a/ext/ftp/tests/ftp_connect_001.phpt +++ b/ext/ftp/tests/ftp_connect_001.phpt @@ -10,5 +10,5 @@ $ftp = ftp_connect('dummy-host-name', 21); var_dump($ftp); ?> --EXPECTF-- -Warning: ftp_connect(): php_network_getaddresses: getaddrinfo for dummy-host-name failed: Temporary failure in name resolution %s +Warning: ftp_connect(): php_network_getaddresses: getaddrinfo for dummy-host-name failed: %s in %s on line %d bool(false) From 5bd557290f8734162d6e9d7478d82deb788b0256 Mon Sep 17 00:00:00 2001 From: Juan Morales Date: Wed, 13 Jul 2022 21:10:41 +0200 Subject: [PATCH 3/3] Adjust connection timeout --- ext/ftp/tests/ftp_connect_001.phpt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/ftp/tests/ftp_connect_001.phpt b/ext/ftp/tests/ftp_connect_001.phpt index 9020461abf0ab..6d155b2b8eead 100644 --- a/ext/ftp/tests/ftp_connect_001.phpt +++ b/ext/ftp/tests/ftp_connect_001.phpt @@ -2,11 +2,9 @@ ftp_connect - return FALSE if connection fails and Waning is generated --EXTENSIONS-- ftp ---INI-- -max_execution_time=2 --FILE-- --EXPECTF--