Skip to content

Commit 59a4e57

Browse files
author
Graham Wharton
committed
Reverted changes made in MAGETWO-96712
1 parent fb572d8 commit 59a4e57

File tree

2 files changed

+4
-44
lines changed

2 files changed

+4
-44
lines changed

lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ class TransportBuilder
4848
*/
4949
protected $templateOptions;
5050

51-
/**
52-
* Mail from address
53-
*
54-
* @var string|array
55-
*/
56-
private $from;
57-
5851
/**
5952
* Mail Transport
6053
*
@@ -280,7 +273,6 @@ protected function reset()
280273
$this->templateIdentifier = null;
281274
$this->templateVars = null;
282275
$this->templateOptions = null;
283-
$this->from = null;
284276
return $this;
285277
}
286278

@@ -314,14 +306,6 @@ protected function prepareMessage()
314306
->setBody($body)
315307
->setSubject(html_entity_decode($template->getSubject(), ENT_QUOTES));
316308

317-
if ($this->from) {
318-
$from = $this->_senderResolver->resolve(
319-
$this->from,
320-
$template->getDesignConfig()->getStore()
321-
);
322-
$this->message->setFrom($from['email'], $from['name']);
323-
}
324-
325309
return $this;
326310
}
327311
}

lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Framework\Mail\Test\Unit\Template;
88

99
use Magento\Framework\App\TemplateTypesInterface;
10-
use Magento\Framework\DataObject;
1110
use Magento\Framework\Mail\MessageInterface;
1211

1312
/**
@@ -100,37 +99,17 @@ protected function setUp()
10099
*/
101100
public function testGetTransport($templateType, $messageType, $bodyText, $templateNamespace)
102101
{
102+
$this->builder->setTemplateModel($templateNamespace);
103+
103104
$vars = ['reason' => 'Reason', 'customer' => 'Customer'];
104105
$options = ['area' => 'frontend', 'store' => 1];
105-
$from = 'email_from';
106-
$sender = ['email' => '[email protected]', 'name' => 'name'];
107-
108-
$this->builder->setTemplateModel($templateNamespace);
109-
$this->builder->setFrom($from);
110106

111-
$template = $this->createPartialMock(
112-
\Magento\Framework\Mail\TemplateInterface::class,
113-
[
114-
'setVars',
115-
'isPlain',
116-
'setOptions',
117-
'getSubject',
118-
'getType',
119-
'processTemplate',
120-
'getDesignConfig',
121-
]
122-
);
107+
$template = $this->createMock(\Magento\Framework\Mail\TemplateInterface::class);
123108
$template->expects($this->once())->method('setVars')->with($this->equalTo($vars))->willReturnSelf();
124109
$template->expects($this->once())->method('setOptions')->with($this->equalTo($options))->willReturnSelf();
125110
$template->expects($this->once())->method('getSubject')->willReturn('Email Subject');
126111
$template->expects($this->once())->method('getType')->willReturn($templateType);
127112
$template->expects($this->once())->method('processTemplate')->willReturn($bodyText);
128-
$template->method('getDesignConfig')->willReturn(new DataObject($options));
129-
130-
$this->senderResolverMock->expects($this->once())
131-
->method('resolve')
132-
->with($from, 1)
133-
->willReturn($sender);
134113

135114
$this->templateFactoryMock->expects($this->once())
136115
->method('get')
@@ -149,9 +128,6 @@ public function testGetTransport($templateType, $messageType, $bodyText, $templa
149128
->method('setBody')
150129
->with($this->equalTo($bodyText))
151130
->willReturnSelf();
152-
$this->messageMock->method('setFrom')
153-
->with($sender['email'], $sender['name'])
154-
->willReturnSelf();
155131

156132
$transport = $this->createMock(\Magento\Framework\Mail\TransportInterface::class);
157133

@@ -184,7 +160,7 @@ public function getTransportDataProvider()
184160
]
185161
];
186162
}
187-
163+
188164
/**
189165
* @return void
190166
*/

0 commit comments

Comments
 (0)