Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,52 @@ public function testSendFullEmailWithSuccess()
$this->assertEquals([new Address('bcc@example.com')], $sentMessage->getOriginalMessage()->getBcc());
}

public function testSendEmailWithAttachmentsWithSuccess()
{
$email = $this->basicValidEmail()
->text('foobar')
->attach('some attachment', 'attachment.txt', 'text/plain')
->embed('some inline attachment', 'inline.txt', 'text/plain')
;

$sentMessage = $this->transport->send($email);

$this->assertInstanceOf(SentMessage::class, $sentMessage);
$this->assertStringMatchesFormat(
<<<'TXT'
%a
Content-Type: multipart/mixed; boundary=%s

--%s
Content-Type: multipart/related; boundary=%s

--%s
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

foobar
--%s
Content-ID: %s
Content-Type: text/plain; name=inline.txt
Content-Transfer-Encoding: base64
Content-Disposition: inline; name=inline.txt; filename=inline.txt

c29tZSBpbmxpbmUgYXR0YWNobWVudA==
--%s--

--%s
Content-Type: text/plain; name=attachment.txt
Content-Transfer-Encoding: base64
Content-Disposition: attachment; name=attachment.txt;
filename=attachment.txt

c29tZSBhdHRhY2htZW50
--%s--
TXT,
$sentMessage->toString()
);
}

public function testSentMessageShouldCaptureInfobipMessageId()
{
$this->response = new MockResponse('{"messages": [{"messageId": "somexternalMessageId0"}]}');
Expand Down