} public function testSendFullEmailShouldCalledInfobipWithTheRightParameters() { $email =
(new Email()) ->
subject('Subject of the email'
) ->
from('From <from@example.com>'
) ->
to('to1@example.com', 'to2@example.com'
) ->
text('Some text'
) ->
html('<html><p>Hello!</p></html>'
) ->
bcc('bcc@example.com'
) ->
cc('cc@example.com'
) ->
date(new \
DateTimeImmutable('2022-04-28 14:00.00',
new \
DateTimeZone('UTC'
))) ->
replyTo('replyTo@example.com'
) ;
$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" <from@example.com>
--%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"
to1@example.com
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="to"
to2@example.com
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="cc"
cc@example.com
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="bcc"
bcc@example.com
--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="replyto"
replyTo@example.com
--%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--