Skip to content

Commit e76f322

Browse files
fix unit tests and array set up
1 parent d434ebc commit e76f322

17 files changed

+37
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function send(Creditmemo $creditmemo, $notify = true, $comment = '')
6868
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
6969

7070
$transport = new \Magento\Framework\Object(
71-
['templateVars' =>
71+
['template_vars' =>
7272
[
7373
'order' => $order,
7474
'creditmemo' => $creditmemo,

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,16 @@ public function send(Creditmemo $creditmemo, $notify = true, $comment = '')
8686
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
8787

8888
$transport = new \Magento\Framework\Object(
89-
['templateVars' =>
89+
['template_vars' =>
9090
[
91-
'order' => $order,
92-
'creditmemo' => $creditmemo,
93-
'comment' => $comment,
94-
'billing' => $order->getBillingAddress(),
95-
'store' => $order->getStore(),
91+
'order' => $creditmemo->getOrder(),
92+
'creditmemo' => $creditmemo,
93+
'comment' => $comment,
94+
'billing' => $order->getBillingAddress(),
95+
'payment_html' => $this->getPaymentHtml($order),
96+
'store' => $order->getStore(),
9697
'formattedShippingAddress' => $formattedShippingAddress,
97-
'formattedBillingAddress' => $formattedBillingAddress,
98+
'formattedBillingAddress' => $formattedBillingAddress
9899
]
99100
]
100101
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function send(Invoice $invoice, $notify = true, $comment = '')
6868
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
6969

7070
$transport = new \Magento\Framework\Object(
71-
['templateVars' =>
71+
['template_vars' =>
7272
[
7373
'order' => $order,
7474
'invoice' => $invoice,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function send(Invoice $invoice, $notify = true, $comment = '')
8686
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
8787

8888
$transport = new \Magento\Framework\Object(
89-
['templateVars' =>
89+
['template_vars' =>
9090
[
9191
'order' => $order,
9292
'invoice' => $invoice,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function send(Order $order, $notify = true, $comment = '')
6666
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
6767

6868
$transport = new \Magento\Framework\Object(
69-
['templateVars' =>
69+
['template_vars' =>
7070
[
7171
'order' => $order,
7272
'comment' => $comment,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function send(Order $order)
9191
protected function prepareTemplate(Order $order)
9292
{
9393
$transport = new \Magento\Framework\Object(
94-
['templateVars' =>
94+
['template_vars' =>
9595
[
9696
'order' => $order,
9797
'billing' => $order->getBillingAddress(),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function send(Shipment $shipment, $notify = true, $comment = '')
6868
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
6969

7070
$transport = new \Magento\Framework\Object(
71-
['templateVars' =>
71+
['template_vars' =>
7272
[
7373
'order' => $order,
7474
'shipment' => $shipment,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function send(Shipment $shipment, $notify = true, $comment = '')
8686
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
8787

8888
$transport = new \Magento\Framework\Object(
89-
['templateVars' =>
89+
['template_vars' =>
9090
[
9191
'order' => $order,
9292
'shipment' => $shipment,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ abstract class AbstractSenderTest extends \PHPUnit_Framework_TestCase
4545
*/
4646
protected $addressMock;
4747

48+
/**
49+
* @var \Magento\Framework\Event\Manager | \PHPUnit_Framework_MockObject_MockObject
50+
*/
51+
protected $eventManagerMock;
52+
4853
public function stepMockSetup()
4954
{
5055
$this->senderBuilderFactoryMock = $this->getMock(
@@ -86,6 +91,7 @@ public function stepMockSetup()
8691
$this->addressRendererMock = $this->getMock('Magento\Sales\Model\Order\Address\Renderer', [], [], '', false);
8792
$this->addressMock = $this->getMock('Magento\Sales\Model\Order\Address', [], [], '', false);
8893
$this->addressRendererMock->expects($this->any())->method('format')->willReturn(1);
94+
$this->eventManagerMock = $this->getMock('Magento\Framework\Event\Manager', [], [], '', false);
8995
}
9096

9197
public function stepAddressFormat($billingAddress)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ protected function setUp()
4040
$this->templateContainerMock,
4141
$this->identityContainerMock,
4242
$this->senderBuilderFactoryMock,
43-
$this->addressRendererMock
43+
$this->addressRendererMock,
44+
$this->eventManagerMock
4445
);
4546
}
4647

0 commit comments

Comments
 (0)