From 9b270d07b8bc3e4b77df63397ac8a24713eeeafe Mon Sep 17 00:00:00 2001 From: Artem Bondarenko Date: Mon, 17 May 2021 22:02:31 +0300 Subject: [PATCH] tests --- tests/Exception/HttpClientExceptionTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Exception/HttpClientExceptionTest.php b/tests/Exception/HttpClientExceptionTest.php index c194df9..89589da 100644 --- a/tests/Exception/HttpClientExceptionTest.php +++ b/tests/Exception/HttpClientExceptionTest.php @@ -60,4 +60,12 @@ class HttpClientExceptionTest extends MailgunTestCase $exception = HttpClientException::forbidden($response); $this->assertStringEndsWith('Forbidden', $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()); + } }