10000 minor #47106 [Mailer] re-add test (xabbuh) · symfony/symfony@4811813 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4811813

Browse files
committed
minor #47106 [Mailer] re-add test (xabbuh)
This PR was merged into the 6.2 branch. Discussion ---------- [Mailer] re-add test | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | This test was initially added in #46211 but failed because of the changes from #46963 that were merged in the meantime. The test was then removed in e54dd38. This is a fixed version that is passing again. Commits ------- 1026e16 re-add test
2 parents 905bc20 + 1026e16 commit 4811813

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/Symfony/Component/Mailer/Bridge/Infobip/Tests/Transport/InfobipApiTransportTest.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,52 @@ public function testSendFullEmailWithSuccess()
316316
$this->assertEquals([new Address('bcc@example.com')], $sentMessage->getOriginalMessage()->getBcc());
317317
}
318318

319+
public function testSendEmailWithAttachmentsWithSuccess()
320+
{
321+
$email = $this->basicValidEmail()
322+
->text('foobar')
323+
->attach('some attachment', 'attachment.txt', 'text/plain')
324+
->embed('some inline attachment', 'inline.txt', 'text/plain')
325+
;
326+
327+
$sentMessage = $this->transport->send($email);
328+
329+
$this->assertInstanceOf(SentMessage::class, $sentMessage);
330+
$this->assertStringMatchesFormat(
331+
<<<'TXT'
332+
%a
333+
Content-Type: multipart/mixed; boundary=%s
334+
335+
--%s
336+
Content-Type: multipart/related; boundary=%s
337+
338+
--%s
339+
Content-Type: text/plain; charset=utf-8
340+
Content-Transfer-Encoding: quoted-printable
341+
342+
foobar
343+
--%s
344+
Content-ID: %s
345+
Content-Type: text/plain; name=inline.txt
346+
Content-Transfer-Encoding: base64
347+
Content-Disposition: inline; name=inline.txt; filename=inline.txt
348+
349+
c29tZSBpbmxpbmUgYXR0YWNobWVudA==
350+
--%s--
351+
352+
--%s
353+
Content-Type: text/plain; name=attachment.txt
354+
Content-Transfer-Encoding: base64
355+
Content-Disposition: attachment; name=attachment.txt;
356+
filename=attachment.txt
357+
358+
c29tZSBhdHRhY2htZW50
359+
--%s--
360+
TXT,
361+
$sentMessage->toString()
362+
);
363+
}
364+
319365
public function testSentMessageShouldCaptureInfobipMessageId()
320366
{
321367
$this->response = new MockResponse('{"messages": [{"messageId": "somexternalMessageId0"}]}');

0 commit comments

Comments
 (0)
0