Skip to content

Commit 72016d6

Browse files
ENGCOM-6207: Fixes unstable email integration tests, by decoding the raw contents … #25296
- Merge Pull Request #25296 from hostep/magento2:fix-unstable-email-tests - Merged commits: 1. 27e8916
2 parents 65763df + 27e8916 commit 72016d6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testConfirm()
100100

101101
$this->assertContains(
102102
'You have been successfully subscribed to our newsletter.',
103-
$transportBuilder->getSentMessage()->getRawMessage()
103+
$transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
104104
);
105105
}
106106
}

dev/tests/integration/testsuite/Magento/ProductAlert/Model/EmailTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function testSend($isCustomerIdUsed)
102102

103103
$this->assertContains(
104104
'John Smith,',
105-
$this->transportBuilder->getSentMessage()->getRawMessage()
105+
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
106106
);
107107
}
108108

dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testProcess()
7171
$this->observer->process();
7272
$this->assertContains(
7373
'John Smith,',
74-
$this->transportBuilder->getSentMessage()->getRawMessage()
74+
$this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent()
7575
);
7676
}
7777

@@ -117,7 +117,7 @@ public function testProcessPortuguese()
117117

118118
// dispatch process() method and check sent message
119119
$this->observer->process();
120-
$message = $this->transportBuilder->getSentMessage()->getRawMessage();
120+
$message = $this->transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent();
121121
$expectedText = array_shift($translation);
122122
$this->assertContains('/frontend/Magento/luma/pt_BR/', $message);
123123
$this->assertContains(substr($expectedText, 0, 50), $message);

dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function testSendAction()
175175
\Magento\TestFramework\Mail\Template\TransportBuilderMock::class
176176
);
177177

178-
$actualResult = quoted_printable_decode($transportBuilder->getSentMessage()->getRawMessage());
178+
$actualResult = $transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent();
179179

180180
$this->assertStringMatchesFormat(
181181
'%A' . $this->_customerViewHelper->getCustomerName($this->_customerSession->getCustomerDataObject())

0 commit comments

Comments
 (0)