Skip to content

Commit ef635bf

Browse files
author
Graham Wharton
committed
Changed references to "Store" to "Scope" in framework components.
1 parent 573cf7a commit ef635bf

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function configureEmailTemplate()
103103
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
104104
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
105105
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
106-
$this->transportBuilder->setFromByStore(
106+
$this->transportBuilder->setFromByScope(
107107
$this->identityContainer->getEmailIdentity(),
108108
$this->identityContainer->getStore()->getId()
109109
);

app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function setUp()
7676
'setTemplateIdentifier',
7777
'setTemplateOptions',
7878
'setTemplateVars',
79-
'setFromByStore',
79+
'setFromByScope',
8080
]
8181
);
8282

@@ -103,7 +103,7 @@ protected function setUp()
103103
->method('getEmailIdentity')
104104
->will($this->returnValue($emailIdentity));
105105
$this->transportBuilder->expects($this->once())
106-
->method('setFromByStore')
106+
->method('setFromByScope')
107107
->with($this->equalTo($emailIdentity), 1);
108108

109109
$this->identityContainerMock->expects($this->once())
@@ -146,7 +146,7 @@ public function testSend()
146146
->method('getId')
147147
->willReturn(1);
148148
$this->transportBuilder->expects($this->once())
149-
->method('setFromByStore')
149+
->method('setFromByScope')
150150
->with($identity, 1);
151151
$this->transportBuilder->expects($this->once())
152152
->method('addTo')
@@ -176,7 +176,7 @@ public function testSendCopyTo()
176176
->method('addTo')
177177
->with($this->equalTo('[email protected]'));
178178
$this->transportBuilder->expects($this->once())
179-
->method('setFromByStore')
179+
->method('setFromByScope')
180180
->with($identity, 1);
181181
$this->identityContainerMock->expects($this->once())
182182
->method('getStore')

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,29 +173,28 @@ public function setReplyTo($email, $name = null)
173173
/**
174174
* Set mail from address
175175
*
176-
* @deprecated This function sets the from address for the first store only.
177-
* new function setFromByStore introduced to allow setting of from address
178-
* based on store.
179-
* @see setFromByStore()
176+
* @deprecated This function sets the from address but does not provide
177+
* a way of setting the correct from addresses based on the scope.
178+
* @see setFromByScope()
180179
*
181180
* @param string|array $from
182181
* @return $this
183182
*/
184183
public function setFrom($from)
185184
{
186-
return $this->setFromByStore($from, null);
185+
return $this->setFromByScope($from, null);
187186
}
188187

189188
/**
190-
* Set mail from address by store
189+
* Set mail from address by Scope
191190
*
192191
* @param string|array $from
193-
* @param string|int $store
192+
* @param string|int $scopeId
194193
* @return $this
195194
*/
196-
public function setFromByStore($from, $store = null)
195+
public function setFromByScope($from, $scopeId = null)
197196
{
198-
$result = $this->_senderResolver->resolve($from, $store);
197+
$result = $this->_senderResolver->resolve($from, $scopeId);
199198
$this->message->setFromAddress($result['email'], $result['name']);
200199
return $this;
201200
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,20 @@ public function getTransportDataProvider()
164164
/**
165165
* @return void
166166
*/
167-
public function testSetFromByStore()
167+
public function testSetFromByScope()
168168
{
169169
$sender = ['email' => '[email protected]', 'name' => 'name'];
170-
$store = 1;
170+
$scopeId = 1;
171171
$this->senderResolverMock->expects($this->once())
172172
->method('resolve')
173-
->with($sender, $store)
173+
->with($sender, $scopeId)
174174
->willReturn($sender);
175175
$this->messageMock->expects($this->once())
176176
->method('setFromAddress')
177177
->with('[email protected]', 'name')
178178
->willReturnSelf();
179179

180-
$this->builder->setFromByStore($sender, $store);
180+
$this->builder->setFromByScope($sender, $scopeId);
181181
}
182182

183183
/**

0 commit comments

Comments
 (0)