public function testSendFullEmailShouldCalledInfobipWithTheRightParameters() { $email =
(new Email()) ->
subject('Subject of the email'
) ->
from('From <
[email protected]>'
) ->
to('
[email protected]', '
[email protected]'
) ->
text('Some text'
) ->
html('<html><p>Hello!</p></html>'
) ->
bcc('
[email protected]'
) ->
cc('
[email protected]'
) ->
date(new \
DateTimeImmutable('2022-04-28 14:00.00',
new \
DateTimeZone('UTC'
))) ->
replyTo('
[email protected]'
) ;
$this->transport->
send($email);
$options =
$this->response->
getRequestOptions();
$this->
arrayHasKey('body'
);
$this->
assertStringMatchesFormat(<<<'TXT'
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="from"
"From" <
[email protected]>
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="subject"
Subject of the email
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="to"
[email protected]
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="to"
[email protected]
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="cc"
[email protected]
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="bcc"
[email protected]
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="replyto"
[email protected]
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="text"
Some text
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="HTML"
<html><p>Hello!</p></html>
--%s--