We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce70b84 commit 66144b5Copy full SHA for 66144b5
1 file changed
Tests/Client/ClientTestCaseTrait.php
@@ -86,6 +86,22 @@ protected function createResource(): \CurlHandle|bool
86
(string)$response->getBody());
87
}
88
89
+ public function test_on_exception()
90
+ {
91
+ $SUT = new class('get', 'http://example.com') extends CurlClient
92
93
+ protected function createResource(): \CurlHandle|bool
94
95
+ throw new \Exception('Exception message');
96
+ }
97
+ };
98
+ $response = $SUT->read();
99
+
100
+ $this->assertSame($response->getHeaderLine('Content-type'), 'application/problem+json');
101
+ $this->assertSame(StatusCode::INTERNAL_SERVER_ERROR, $response->getStatusCode());
102
+ $this->assertStringContainsString('Exception message', (string)$response->getBody());
103
104
105
protected function tearDown(): void
106
{
107
$this->SUT = null;
0 commit comments