Skip to content

Commit 3e3f35e

Browse files
committed
MDVA-275: Emails from admin being sent out using default config’s email, not the specific store email
1 parent 9fc059b commit 3e3f35e

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ public function testSendPaymentFailedEmail()
166166
$this->returnSelf()
167167
);
168168

169+
$this->_transportBuilder->expects(
170+
$this->once()
171+
)->method(
172+
'setScopeId'
173+
)->with(
174+
8
175+
)->will(
176+
$this->returnSelf()
177+
);
178+
169179
$this->_transportBuilder->expects(
170180
$this->once()
171181
)->method(

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,10 @@ public function testCreateAccountWithoutPassword()
650650
$this->transportBuilder->expects($this->once())
651651
->method('setTemplateVars')
652652
->willReturnSelf();
653+
$this->transportBuilder->expects($this->once())
654+
->method('setScopeId')
655+
->with($defaultStoreId)
656+
->willReturnSelf();
653657
$this->transportBuilder->expects($this->once())
654658
->method('setFrom')
655659
->with($sender)
@@ -799,6 +803,10 @@ function ($string) {
799803
$this->transportBuilder->expects($this->once())
800804
->method('setTemplateVars')
801805
->willReturnSelf();
806+
$this->transportBuilder->expects($this->once())
807+
->method('setScopeId')
808+
->with($defaultStoreId)
809+
->willReturnSelf();
802810
$this->transportBuilder->expects($this->once())
803811
->method('setFrom')
804812
->with($sender)
@@ -901,6 +909,10 @@ public function testSendPasswordReminderEmail()
901909
->method('setTemplateVars')
902910
->with(['customer' => $this->customerSecure, 'store' => $this->store])
903911
->willReturnSelf();
912+
$this->transportBuilder->expects($this->once())
913+
->method('setScopeId')
914+
->with($customerStoreId)
915+
->willReturnSelf();
904916
$this->transportBuilder->expects($this->once())
905917
->method('setFrom')
906918
->with($sender)
@@ -1031,6 +1043,10 @@ protected function prepareEmailSend($email, $templateIdentifier, $sender, $store
10311043
->method('setTemplateVars')
10321044
->with(['customer' => $this->customerSecure, 'store' => $this->store])
10331045
->willReturnSelf();
1046+
$this->transportBuilder->expects($this->any())
1047+
->method('setScopeId')
1048+
->with($storeId)
1049+
->willReturnSelf();
10341050
$this->transportBuilder->expects($this->any())
10351051
->method('setFrom')
10361052
->with($sender)

app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ public function testSendNewAccountEmailWithoutStoreId()
215215
'setTemplateIdentifier',
216216
'setTemplateOptions',
217217
'setTemplateVars',
218+
'setScopeId',
218219
'setFrom',
219220
'addTo',
220221
];

app/code/Magento/Wishlist/Test/Unit/Controller/Index/SendTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,10 @@ public function testExecute()
662662
'store' => $this->store,
663663
])
664664
->willReturnSelf();
665+
$this->transportBuilder->expects($this->once())
666+
->method('setScopeId')
667+
->with($storeId)
668+
->willReturnSelf();
665669
$this->transportBuilder->expects($this->once())
666670
->method('setFrom')
667671
->with($from)

0 commit comments

Comments
 (0)