Skip to content

Commit

Permalink
[BUGFIX] Add recipient to FluidEmail Test cases to avoid errors
Browse files Browse the repository at this point in the history
The to header is mandatory by now, so we need to supply the recipient
in our testcases now.

Resolves: #91346
Releases: master
Change-Id: Ic1a3197a8412b27eb5cebb00a1443f10021b9326
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64438
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
maddy2101 authored and andreaskienast committed May 8, 2020
1 parent b7dc8b2 commit 02856fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions typo3/sysext/core/Tests/Functional/Mail/FluidEmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public function settingFormatWithTextOnlyGeneratesTextEmail()
->format(FluidEmail::FORMAT_PLAIN)
->setTemplate('Default')
->from('benniYYYY@typo3.org')
->assign('content', 'Plain content from Functional test');
->assign('content', 'Plain content from Functional test')
->to('some-recipient@example.com');
$result = $subject->getBody();
self::assertEquals('plain', $result->getMediaSubtype());
self::assertStringContainsString('Plain content from Functional test', $result->bodyToString());
Expand All @@ -50,7 +51,8 @@ public function settingFormatWithHtmlOnlyGeneratesHtmlEmail()
->format(FluidEmail::FORMAT_HTML)
->setTemplate('Default')
->from('benniYYYY@typo3.org')
->assign('content', 'HTML content <strong>from</strong> Functional test');
->assign('content', 'HTML content <strong>from</strong> Functional test')
->to('some-recipient@example.com');
$result = $subject->getBody();
self::assertEquals('html', $result->getMediaSubtype());
self::assertStringContainsString('&lt;strong&gt;from&lt;/strong&gt;', $result->bodyToString());
Expand All @@ -68,7 +70,8 @@ public function settingFormatWithTextAndHtmlGeneratesTwoBodies()
->format(FluidEmail::FORMAT_BOTH)
->setTemplate('Default')
->from('benniYYYY@typo3.org')
->assign('content', 'Plain content <strong>from</strong> Functional test');
->assign('content', 'Plain content <strong>from</strong> Functional test')
->to('some-recipient@example.com');
$result = $subject->getBody();
self::assertEquals('alternative', $result->getMediaSubtype());
self::assertStringContainsString('&lt;strong&gt;from&lt;/strong&gt;', $result->bodyToString());
Expand Down

0 comments on commit 02856fc

Please sign in to comment.