-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
|
||
class SendEmailRequestTest extends TestCase | ||
{ | ||
public function testRequestBody(): void | ||
public function testRequest(): void | ||
{ | ||
$input = new SendEmailRequest([ | ||
'FromEmailAddress' => '[email protected]', | ||
|
@@ -43,37 +43,42 @@ public function testRequestBody(): void | |
]); | ||
|
||
// see example-1.json from SDK | ||
$expected = '{ | ||
"FromEmailAddress": "[email protected]", | ||
"Destination": { | ||
"ToAddresses": [ | ||
"[email protected]", | ||
"[email protected]" | ||
], | ||
"CcAddresses": [ | ||
"[email protected]" | ||
] | ||
}, | ||
"Content": { | ||
"Simple": { | ||
"Subject": { | ||
"Data": "Test email", | ||
"Charset": "UTF-8" | ||
}, | ||
"Body": { | ||
"Text": { | ||
"Data": "This is the message body in text format.", | ||
$expected = ' | ||
POST /v2/email/outbound-emails HTTP/1.0 | ||
Content-Type: application/json | ||
{ | ||
"FromEmailAddress": "[email protected]", | ||
"Destination": { | ||
"ToAddresses": [ | ||
"[email protected]", | ||
"[email protected]" | ||
], | ||
"CcAddresses": [ | ||
"[email protected]" | ||
] | ||
}, | ||
"Content": { | ||
"Simple": { | ||
"Subject": { | ||
"Data": "Test email", | ||
"Charset": "UTF-8" | ||
}, | ||
"Html": { | ||
"Data": "This message body contains HTML formatting. It can, for example, contain links like this one: <a class=\\"ulink\\" href=\\"http:\\/\\/docs.aws.amazon.com\\/ses\\/latest\\/DeveloperGuide\\" target=\\"_blank\\">Amazon SES Developer Guide<\\/a>.", | ||
"Charset": "UTF-8" | ||
"Body": { | ||
"Text": { | ||
"Data": "This is the message body in text format.", | ||
"Charset": "UTF-8" | ||
}, | ||
"Html": { | ||
"Data": "This message body contains HTML formatting. It can, for example, contain links like this one: <a class=\\"ulink\\" href=\\"http:\\/\\/docs.aws.amazon.com\\/ses\\/latest\\/DeveloperGuide\\" target=\\"_blank\\">Amazon SES Developer Guide<\\/a>.", | ||
"Charset": "UTF-8" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}'; | ||
'; | ||
|
||
self::assertJsonStringEqualsJsonString($expected, $input->request()->getBody()->stringify()); | ||
self::assertRequestEqualsHttpRequest($expected, $input->request()); | ||
} | ||
} |