mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 18:25:13 +00:00
getaddrinfo error message seems to be unstable, add tolerance to test
This commit is contained in:
parent
92a67a03aa
commit
a7fc232c63
@ -12,7 +12,11 @@ class SFTPWrongServerTest extends TestCase
|
|||||||
(new SFTP('dummy-server'))->login('username', 'password');
|
(new SFTP('dummy-server'))->login('username', 'password');
|
||||||
static::fail('The connection to the non-existent server must not succeed.');
|
static::fail('The connection to the non-existent server must not succeed.');
|
||||||
} catch (UnableToConnectException $e) {
|
} 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());
|
// getaddrinfo message seems not to return stable text
|
||||||
|
static::assertSame(
|
||||||
|
'Cannot connect to dummy-server:22. Error 0. php_network_getaddresses: getaddrinfo failed:',
|
||||||
|
substr($e->getMessage(),0,89)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user