We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9583dd commit 465ff81Copy full SHA for 465ff81
1 file changed
tests/ClientTest.php
@@ -99,11 +99,19 @@ public function testRunError() : void
99
try {
100
$this->client->run($request);
101
} catch (RequestException $exception) {
102
- self::assertSame(
+ $expected = \str_starts_with($exception->getMessage(), 'Could')
103
+ ? 0
104
+ : 1;
105
+ $messages = [
106
+ 'Could not resolve host: domain.tld',
107
'Failed to connect to domain.tld port 80: No route to host',
- $exception->getMessage()
- );
- self::assertSame(7, $exception->getCode());
108
+ ];
109
+ $codes = [
110
+ 6,
111
+ 7,
112
113
+ self::assertSame($messages[$expected], $exception->getMessage());
114
+ self::assertSame($codes[$expected], $exception->getCode());
115
self::assertEmpty($exception->getInfo());
116
}
117
0 commit comments