Skip to content

Commit

Permalink
Changed references to "Store" to "Scope" in framework components.
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Wharton committed Jan 25, 2019
1 parent 573cf7a commit ef635bf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function configureEmailTemplate()
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
$this->transportBuilder->setFromByStore(
$this->transportBuilder->setFromByScope(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function setUp()
'setTemplateIdentifier',
'setTemplateOptions',
'setTemplateVars',
'setFromByStore',
'setFromByScope',
]
);

Expand All @@ -103,7 +103,7 @@ protected function setUp()
->method('getEmailIdentity')
->will($this->returnValue($emailIdentity));
$this->transportBuilder->expects($this->once())
->method('setFromByStore')
->method('setFromByScope')
->with($this->equalTo($emailIdentity), 1);

$this->identityContainerMock->expects($this->once())
Expand Down Expand Up @@ -146,7 +146,7 @@ public function testSend()
->method('getId')
->willReturn(1);
$this->transportBuilder->expects($this->once())
->method('setFromByStore')
->method('setFromByScope')
->with($identity, 1);
$this->transportBuilder->expects($this->once())
->method('addTo')
Expand Down Expand Up @@ -176,7 +176,7 @@ public function testSendCopyTo()
->method('addTo')
->with($this->equalTo('example@mail.com'));
$this->transportBuilder->expects($this->once())
->method('setFromByStore')
->method('setFromByScope')
->with($identity, 1);
$this->identityContainerMock->expects($this->once())
->method('getStore')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,29 +173,28 @@ public function setReplyTo($email, $name = null)
/**
* Set mail from address
*
* @deprecated This function sets the from address for the first store only.
* new function setFromByStore introduced to allow setting of from address
* based on store.
* @see setFromByStore()
* @deprecated This function sets the from address but does not provide
* a way of setting the correct from addresses based on the scope.
* @see setFromByScope()
*
* @param string|array $from
* @return $this
*/
public function setFrom($from)
{
return $this->setFromByStore($from, null);
return $this->setFromByScope($from, null);
}

/**
* Set mail from address by store
* Set mail from address by Scope
*
* @param string|array $from
* @param string|int $store
* @param string|int $scopeId
* @return $this
*/
public function setFromByStore($from, $store = null)
public function setFromByScope($from, $scopeId = null)
{
$result = $this->_senderResolver->resolve($from, $store);
$result = $this->_senderResolver->resolve($from, $scopeId);
$this->message->setFromAddress($result['email'], $result['name']);
return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,20 @@ public function getTransportDataProvider()
/**
* @return void
*/
public function testSetFromByStore()
public function testSetFromByScope()
{
$sender = ['email' => 'from@example.com', 'name' => 'name'];
$store = 1;
$scopeId = 1;
$this->senderResolverMock->expects($this->once())
->method('resolve')
->with($sender, $store)
->with($sender, $scopeId)
->willReturn($sender);
$this->messageMock->expects($this->once())
->method('setFromAddress')
->with('from@example.com', 'name')
->willReturnSelf();

$this->builder->setFromByStore($sender, $store);
$this->builder->setFromByScope($sender, $scopeId);
}

/**
Expand Down

0 comments on commit ef635bf

Please sign in to comment.