Skip to content

Commit 2a9a85b

Browse files
committed
MC-15295: Fix integration tests
1 parent 2b77950 commit 2a9a85b

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

dev/tests/integration/testsuite/Magento/Framework/Mail/EmailMessageTest.php

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,19 @@ public function getEmailMessageDataProvider(): array
118118
*/
119119
public function testEmailMessage($content, $type): void
120120
{
121-
$mimePart = $this->mimePartFactory->create([
122-
'content' => $content,
123-
'description' => $this->description,
124-
'type' => $type
125-
]);
121+
$mimePart = $this->mimePartFactory->create(
122+
[
123+
'content' => $content,
124+
'description' => $this->description,
125+
'type' => $type
126+
]
127+
);
126128

127-
$mimeMessage = $this->mimeMessageFactory->create([
128-
'parts' => [$mimePart]
129-
]);
129+
$mimeMessage = $this->mimeMessageFactory->create(
130+
[
131+
'parts' => [$mimePart]
132+
]
133+
);
130134

131135
$this->addressFactory = $this->di->get(AddressFactory::class);
132136
/** @var Address $addressTo */
@@ -194,21 +198,27 @@ public function testEmailMessage($content, $type): void
194198
*/
195199
public function testEmailMessageWithAttachment(): void
196200
{
197-
$mimePartMain = $this->mimePartFactory->create([
198-
'content' => 'Test',
199-
'description' => $this->description,
200-
'type' => MimeInterface::TYPE_TEXT
201-
]);
202-
$mimePartAttachment = $this->mimePartFactory->create([
203-
'content' => $this->getXmlContent(),
204-
'disposition' => MimeInterface::DISPOSITION_ATTACHMENT,
205-
'fileName' => self::ATTACHMENT_FILE_NAME,
206-
'type' => self::XML_TYPE
207-
]);
201+
$mimePartMain = $this->mimePartFactory->create(
202+
[
203+
'content' => 'Test',
204+
'description' => $this->description,
205+
'type' => MimeInterface::TYPE_TEXT
206+
]
207+
);
208+
$mimePartAttachment = $this->mimePartFactory->create(
209+
[
210+
'content' => $this->getXmlContent(),
211+
'disposition' => MimeInterface::DISPOSITION_ATTACHMENT,
212+
'fileName' => self::ATTACHMENT_FILE_NAME,
213+
'type' => self::XML_TYPE
214+
]
215+
);
208216

209-
$mimeMessage = $this->mimeMessageFactory->create([
210-
'parts' => [$mimePartMain, $mimePartAttachment]
211-
]);
217+
$mimeMessage = $this->mimeMessageFactory->create(
218+
[
219+
'parts' => [$mimePartMain, $mimePartAttachment]
220+
]
221+
);
212222

213223
$this->addressFactory = $this->di->get(AddressFactory::class);
214224
/** @var Address $addressTo */
@@ -242,7 +252,8 @@ public function testEmailMessageWithAttachment(): void
242252
private function getXmlContent(): string
243253
{
244254
return '<?xml version="1.0"?>
245-
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
255+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
256+
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
246257
<type name="Magento\Framework\Console\CommandList">
247258
<arguments>
248259
<argument name="commands" xsi:type="array">

lib/internal/Magento/Framework/Mail/EmailMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(
8989
$this->message->setReplyTo($this->convertAddressArrayToAddressList($replyTo));
9090
}
9191
if ($replyTo) {
92-
$this->message->setFrom($this->convertAddressArrayToAddressList($replyTo));
92+
$this->message->setFrom($this->convertAddressArrayToAddressList($from));
9393
}
9494
if ($cc) {
9595
$this->message->setCc($this->convertAddressArrayToAddressList($cc));

0 commit comments

Comments
 (0)