mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +00:00
Merge branch '3.0'
This commit is contained in:
commit
497900643f
18
tests/Functional/Net/SFTPWrongServerTest.php
Normal file
18
tests/Functional/Net/SFTPWrongServerTest.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use phpseclib\Net\SFTP;
|
||||||
|
use phpseclib\Exception\UnableToConnectException;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class SFTPWrongServerTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testLoginToInvalidServer()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
(new SFTP('dummy-server'))->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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user