Skip to content

Commit 0e145f1

Browse files
ENGCOM-4101: #18698 Fixed order email sending via order async email sending when order was created with disabled email sending #20953
- Merge Pull Request #20953 from serhiyzhovnir/magento2:issue-18698-fixed-order-email-sending-via-order-async-email-sending-when-order-was-created-with-disabled-email-sending - Merged commits: 1. be87471 2. 600e090 3. 1efb4a9
2 parents fa8cc6e + 1efb4a9 commit 0e145f1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class OrderSender extends Sender
5555
* @param OrderIdentity $identityContainer
5656
* @param Order\Email\SenderBuilderFactory $senderBuilderFactory
5757
* @param \Psr\Log\LoggerInterface $logger
58+
* @param Renderer $addressRenderer
5859
* @param PaymentHelper $paymentHelper
5960
* @param OrderResource $orderResource
6061
* @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
61-
* @param Renderer $addressRenderer
6262
* @param ManagerInterface $eventManager
6363
*/
6464
public function __construct(

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult, $sen
6464

6565
$this->orderMock->expects($this->once())
6666
->method('setSendEmail')
67-
->with(true);
67+
->with($emailSendingResult);
6868

6969
$this->globalConfig->expects($this->once())
7070
->method('getValue')
7171
->with($configPath)
7272
->willReturn($configValue);
7373

7474
if (!$configValue || $forceSyncMode) {
75-
$this->identityContainerMock->expects($this->once())
75+
$this->identityContainerMock->expects($this->exactly(2))
7676
->method('isEnabled')
7777
->willReturn($emailSendingResult);
7878

@@ -118,7 +118,7 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult, $sen
118118

119119
$this->orderMock->expects($this->once())
120120
->method('setEmailSent')
121-
->with(true);
121+
->with($emailSendingResult);
122122

123123
$this->orderResourceMock->expects($this->once())
124124
->method('saveAttribute')
@@ -210,7 +210,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
210210
->with('sales_email/general/async_sending')
211211
->willReturn(false);
212212

213-
$this->identityContainerMock->expects($this->once())
213+
$this->identityContainerMock->expects($this->exactly(2))
214214
->method('isEnabled')
215215
->willReturn(true);
216216

0 commit comments

Comments
 (0)