From 05bf34860df571199806e8176650237823c174a3 Mon Sep 17 00:00:00 2001 From: Vladmir Gaydamaka Date: Tue, 17 Sep 2019 13:09:51 +0300 Subject: [PATCH] Added test SFTPWrongServerTest --- tests/Functional/Net/SFTPWrongServerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/Functional/Net/SFTPWrongServerTest.php diff --git a/tests/Functional/Net/SFTPWrongServerTest.php b/tests/Functional/Net/SFTPWrongServerTest.php new file mode 100644 index 00000000..0a715f1e --- /dev/null +++ b/tests/Functional/Net/SFTPWrongServerTest.php @@ -0,0 +1,18 @@ +login('username', 'password'); + static::fail('The connection to the non-existent server must not succeed.'); + } catch (UnableToConnectException $e) { + static::assertSame('Cannot connect to dummy-server:22. Error 0. php_network_getaddresses: getaddrinfo failed: Name or service not known', $e->getMessage()); + } + } +}