File tree Expand file tree Collapse file tree 4 files changed +38
-6
lines changed
dev/tests/integration/testsuite/Magento/Wishlist/Controller
lib/internal/Magento/Framework/Mail Expand file tree Collapse file tree 4 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ public function testSendAction()
158
158
);
159
159
160
160
$ actualResult = \Zend_Mime_Decode::decodeQuotedPrintable (
161
- $ transportBuilder ->getSentMessage ()->getBodyHtml ()-> getContent ()
161
+ $ transportBuilder ->getSentMessage ()->getRawMessage ()
162
162
);
163
163
164
164
$ this ->assertStringMatchesFormat (
Original file line number Diff line number Diff line change @@ -64,52 +64,85 @@ public function setBody($body)
64
64
return $ this ;
65
65
}
66
66
67
+ /**
68
+ * @param string $subject
69
+ * @return $this
70
+ */
67
71
public function setSubject ($ subject )
68
72
{
69
73
$ this ->zendMessage ->setSubject ($ subject );
70
74
return $ this ;
71
75
}
72
76
77
+ /**
78
+ * @return null|string
79
+ */
73
80
public function getSubject ()
74
81
{
75
82
return $ this ->zendMessage ->getSubject ();
76
83
}
77
84
85
+ /**
86
+ * @return object
87
+ */
78
88
public function getBody ()
79
89
{
80
90
return $ this ->zendMessage ->getBody ();
81
91
}
82
92
93
+ /**
94
+ * @param array|string $fromAddress
95
+ * @return $this
96
+ */
83
97
public function setFrom ($ fromAddress )
84
98
{
85
99
$ this ->zendMessage ->setFrom ($ fromAddress );
86
100
return $ this ;
87
101
}
88
102
103
+ /**
104
+ * @param array|string $toAddress
105
+ * @return $this
106
+ */
89
107
public function addTo ($ toAddress )
90
108
{
91
109
$ this ->zendMessage ->addTo ($ toAddress );
92
110
return $ this ;
93
111
}
94
112
113
+ /**
114
+ * @param array|string $ccAddress
115
+ * @return $this
116
+ */
95
117
public function addCc ($ ccAddress )
96
118
{
97
119
$ this ->zendMessage ->addCc ($ ccAddress );
98
120
return $ this ;
99
121
}
100
122
123
+ /**
124
+ * @param array|string $bccAddress
125
+ * @return $this
126
+ */
101
127
public function addBcc ($ bccAddress )
102
128
{
103
129
$ this ->zendMessage ->addBcc ($ bccAddress );
104
130
return $ this ;
105
131
}
106
132
133
+ /**
134
+ * @param array|string $replyToAddress
135
+ * @return $this
136
+ */
107
137
public function setReplyTo ($ replyToAddress )
108
138
{
109
139
$ this ->zendMessage ->setReplyTo ($ replyToAddress );
110
140
return $ this ;
111
141
}
112
142
143
+ /**
144
+ * @return string
145
+ */
113
146
public function getRawMessage ()
114
147
{
115
148
return $ this ->zendMessage ->toString ();
Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Framework \App \TemplateTypesInterface ;
9
9
use Magento \Framework \Mail \MessageInterface ;
10
- use Zend \Mail \Headers ;
11
10
12
11
class TransportBuilderTest extends \PHPUnit_Framework_TestCase
13
12
{
@@ -54,7 +53,6 @@ protected function setUp()
54
53
$ objectManagerHelper = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
55
54
$ this ->templateFactoryMock = $ this ->getMock (\Magento \Framework \Mail \Template \FactoryInterface::class);
56
55
$ this ->messageMock = $ this ->getMock (\Magento \Framework \Mail \Message::class);
57
- $ this ->messageMock ->method ('getHeaders ' )->willReturn (new Headers ());
58
56
$ this ->objectManagerMock = $ this ->getMock (\Magento \Framework \ObjectManagerInterface::class);
59
57
$ this ->senderResolverMock = $ this ->getMock (\Magento \Framework \Mail \Template \SenderResolverInterface::class);
60
58
$ this ->mailTransportFactoryMock = $ this ->getMockBuilder (
Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ class Transport implements \Magento\Framework\Mail\TransportInterface
12
12
* @var \Zend\Mail\Transport\Sendmail
13
13
*/
14
14
private $ zendTransport ;
15
+
15
16
/**
16
17
* @var \Magento\Framework\Mail\MessageInterface
17
18
*/
18
- protected $ _message ;
19
+ private $ message ;
19
20
20
21
/**
21
22
* @param MessageInterface $message
@@ -25,7 +26,7 @@ class Transport implements \Magento\Framework\Mail\TransportInterface
25
26
public function __construct (\Magento \Framework \Mail \MessageInterface $ message , $ parameters = null )
26
27
{
27
28
$ this ->zendTransport = new \Zend \Mail \Transport \Sendmail ($ parameters );
28
- $ this ->_message = $ message ;
29
+ $ this ->message = $ message ;
29
30
}
30
31
31
32
/**
@@ -38,7 +39,7 @@ public function sendMessage()
38
39
{
39
40
try {
40
41
$ this ->zendTransport ->send (
41
- \Zend \Mail \Message::fromString ($ this ->_message ->getRawMessage ())
42
+ \Zend \Mail \Message::fromString ($ this ->message ->getRawMessage ())
42
43
);
43
44
} catch (\Exception $ e ) {
44
45
throw new \Magento \Framework \Exception \MailException (new \Magento \Framework \Phrase ($ e ->getMessage ()), $ e );
You can’t perform that action at this time.
0 commit comments