File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
dev/tests/integration/testsuite/Magento/Customer/Controller Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -769,7 +769,19 @@ public function testConfirmationEmailWithSpecialCharacters(): void
769
769
$ message = $ this ->transportBuilderMock ->getSentMessage ();
770
770
$ rawMessage = $ message ->getRawMessage ();
771
771
772
- $ this ->assertContains ('To: John Smith < ' . $ email . '> ' , $ rawMessage );
772
+ /** @var \Zend\Mime\Part $messageBodyPart */
773
+ $ messageBodyParts = $ message ->getBody ()->getParts ();
774
+ $ messageBodyPart = reset ($ messageBodyParts );
775
+ $ messageEncoding = $ messageBodyPart ->getCharset ();
776
+ $ name = 'John Smith ' ;
777
+
778
+ if (strtoupper ($ messageEncoding ) !== 'ASCII ' ) {
779
+ $ name = \Zend \Mail \Header \HeaderWrap::mimeEncodeValue ($ name , $ messageEncoding );
780
+ }
781
+
782
+ $ nameEmail = sprintf ('%s <%s> ' , $ name , $ email );
783
+
784
+ $ this ->assertContains ('To: ' . $ nameEmail , $ rawMessage );
773
785
774
786
$ content = $ message ->getBody ()->getParts ()[0 ]->getRawContent ();
775
787
$ confirmationUrl = $ this ->getConfirmationUrlFromMessageContent ($ content );
You can’t perform that action at this time.
0 commit comments