This commit is contained in:
Artem Bondarenko 2021-05-17 22:02:31 +03:00 committed by David Garcia
parent a0352e8f51
commit 9b270d07b8

View File

@ -60,4 +60,12 @@ class HttpClientExceptionTest extends MailgunTestCase
$exception = HttpClientException::forbidden($response);
$this->assertStringEndsWith('<html><body>Forbidden</body></html>', $exception->getMessage());
}
public function testTooManyRequestsGetMessage()
{
$response = new Response(429, ['Content-Type' => 'text/html']);
$exception = HttpClientException::tooManyRequests($response);
$this->assertEquals('Too many requests.', $exception->getMessage());
$this->assertEquals($response->getStatusCode(), $exception->getCode());
}
}