Fix SES test

This commit is contained in:
Jérémy Derussé 2021-01-27 18:47:53 +01:00
parent 8449d8a328
commit 2176ff6550
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
2 changed files with 16 additions and 14 deletions

View File

@ -100,15 +100,16 @@ class SesApiAsyncAwsTransportTest extends TestCase
public function testSendThrowsForErrorResponse()
{
$client = new MockHttpClient(function (string $method, string $url, array $options): ResponseInterface {
$xml = "<SendEmailResponse xmlns=\"https://email.amazonaws.com/doc/2010-03-31/\">
<Error>
<Message>i'm a teapot</Message>
<Code>418</Code>
</Error>
</SendEmailResponse>";
$json = json_encode([
'message' => 'i\'m a teapot',
'type' => 'sender',
]);
return new MockResponse($xml, [
return new MockResponse($json, [
'http_code' => 418,
'response_headers' => [
'x-amzn-errortype' => '418',
],
]);
});

View File

@ -95,15 +95,16 @@ class SesHttpAsyncAwsTransportTest extends TestCase
public function testSendThrowsForErrorResponse()
{
$client = new MockHttpClient(function (string $method, string $url, array $options): ResponseInterface {
$xml = "<SendEmailResponse xmlns=\"https://email.amazonaws.com/doc/2010-03-31/\">
<Error>
<Message>i'm a teapot</Message>
<Code>418</Code>
</Error>
</SendEmailResponse>";
$json = json_encode([
'message' => 'i\'m a teapot',
'type' => 'sender',
]);
return new MockResponse($xml, [
return new MockResponse($json, [
'http_code' => 418,
'response_headers' => [
'x-amzn-errortype' => '418',
],
]);
});