Skip to content

Commit 56f8bf8

Browse files
author
Rafael Kassner
committed
Implement unit tests
1 parent 1000822 commit 56f8bf8

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
250250
->method('setSendEmail')
251251
->with($emailSendingResult);
252252

253+
$this->orderMock->method('getCustomerName')->willReturn('Customer name');
254+
$this->orderMock->method('getIsNotVirtual')->willReturn(true);
255+
$this->orderMock->method('getEmailCustomerNote')->willReturn(null);
256+
$this->orderMock->method('getFrontendStatusLabel')->willReturn('Pending');
257+
253258
if (!$configValue || $forceSyncMode) {
254259
$transport = [
255260
'order' => $this->orderMock,
@@ -260,6 +265,12 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
260265
'store' => $this->storeMock,
261266
'formattedShippingAddress' => 'Formatted address',
262267
'formattedBillingAddress' => 'Formatted address',
268+
'order_data' => [
269+
'customer_name' => 'Customer name',
270+
'is_not_virtual' => true,
271+
'email_customer_note' => null,
272+
'frontend_status_label' => 'Pending',
273+
],
263274
];
264275
$transport = new \Magento\Framework\DataObject($transport);
265276

app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
249249
->method('setSendEmail')
250250
->with($emailSendingResult);
251251

252+
$this->orderMock->method('getCustomerName')->willReturn('Customer name');
253+
$this->orderMock->method('getIsNotVirtual')->willReturn(true);
254+
$this->orderMock->method('getEmailCustomerNote')->willReturn(null);
255+
$this->orderMock->method('getFrontendStatusLabel')->willReturn('Pending');
256+
252257
if (!$configValue || $forceSyncMode) {
253258
$transport = [
254259
'order' => $this->orderMock,
@@ -259,6 +264,12 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
259264
'store' => $this->storeMock,
260265
'formattedShippingAddress' => 'Formatted address',
261266
'formattedBillingAddress' => 'Formatted address',
267+
'order_data' => [
268+
'customer_name' => 'Customer name',
269+
'is_not_virtual' => true,
270+
'email_customer_note' => null,
271+
'frontend_status_label' => 'Pending',
272+
],
262273
];
263274
$transport = new \Magento\Framework\DataObject($transport);
264275

app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
251251
->method('setSendEmail')
252252
->with($emailSendingResult);
253253

254+
$this->orderMock->method('getCustomerName')->willReturn('Customer name');
255+
$this->orderMock->method('getIsNotVirtual')->willReturn(true);
256+
$this->orderMock->method('getEmailCustomerNote')->willReturn(null);
257+
$this->orderMock->method('getFrontendStatusLabel')->willReturn('Pending');
258+
254259
if (!$configValue || $forceSyncMode) {
255260
$transport = [
256261
'order' => $this->orderMock,
@@ -261,6 +266,12 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
261266
'store' => $this->storeMock,
262267
'formattedShippingAddress' => 'Formatted address',
263268
'formattedBillingAddress' => 'Formatted address',
269+
'order_data' => [
270+
'customer_name' => 'Customer name',
271+
'is_not_virtual' => true,
272+
'email_customer_note' => null,
273+
'frontend_status_label' => 'Pending',
274+
],
264275
];
265276
$transport = new \Magento\Framework\DataObject($transport);
266277

0 commit comments

Comments
 (0)