From c12bdeacd36440ef1a3e0de302e01233ba3bd62d Mon Sep 17 00:00:00 2001 From: Evgeni Obukhovsky Date: Wed, 24 May 2017 23:00:11 +0300 Subject: [PATCH 1/3] make sales emails' transport variable changeable from observer --- .../Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/CreditmemoSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/InvoiceCommentSender.php | 3 ++- .../Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/OrderCommentSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/ShipmentCommentSender.php | 3 ++- .../Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php | 3 ++- .../Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php | 3 ++- .../Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php index 510bc54dc05b3..85a607b1b2aa6 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php @@ -71,13 +71,14 @@ public function send(Creditmemo $creditmemo, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_creditmemo_comment_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); return $this->checkAndSend($order, $notify); } diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php index a4ecd2aa7d000..b0fb8958515c9 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php @@ -113,13 +113,14 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_creditmemo_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); if ($this->checkAndSend($order)) { $creditmemo->setEmailSent(true); diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php index 8f6401ff1cb88..76b572705c14f 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php @@ -71,13 +71,14 @@ public function send(Invoice $invoice, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_invoice_comment_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); return $this->checkAndSend($order, $notify); } diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php index c3083ddae2dd8..c9037beed0a01 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php @@ -113,13 +113,14 @@ public function send(Invoice $invoice, $forceSyncMode = false) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order) ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_invoice_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); if ($this->checkAndSend($order)) { $invoice->setEmailSent(true); diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php index c8c1eb10d4864..586bfc49bfc37 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php @@ -68,13 +68,14 @@ public function send(Order $order, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_order_comment_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); return $this->checkAndSend($order, $notify); } diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php index 80c2ed356061b..1dcb40deac1ee 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php @@ -71,13 +71,14 @@ public function send(Shipment $shipment, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_shipment_comment_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); return $this->checkAndSend($order, $notify); } diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php index ff2311067ba0a..e42dee71377c1 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php @@ -113,13 +113,14 @@ public function send(Shipment $shipment, $forceSyncMode = false) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order) ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_shipment_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); if ($this->checkAndSend($order)) { $shipment->setEmailSent(true); diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php index 5daab1f4d9bd3..1924549280191 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php @@ -106,13 +106,14 @@ public function send( 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_invoice_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); if ($this->checkAndSend($order)) { $invoice->setEmailSent(true); diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php index 7c17a2d2d2f64..31a6c289f0836 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php @@ -106,13 +106,14 @@ public function send( 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order) ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManager->dispatch( 'email_shipment_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); if ($this->checkAndSend($order)) { $shipment->setEmailSent(true); From a42284b41b3aba89df042fa60c7043aaf0821056 Mon Sep 17 00:00:00 2001 From: Evgeni Obukhovsky Date: Wed, 24 May 2017 23:06:24 +0300 Subject: [PATCH 2/3] add magento\data\object to use; section --- .../Sales/Model/Order/Creditmemo/Sender/EmailSender.php | 4 +++- .../Model/Order/Email/Sender/CreditmemoCommentSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/CreditmemoSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/InvoiceCommentSender.php | 3 ++- .../Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/OrderCommentSender.php | 3 ++- .../Magento/Sales/Model/Order/Email/Sender/OrderSender.php | 3 ++- .../Sales/Model/Order/Email/Sender/ShipmentCommentSender.php | 3 ++- .../Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php | 3 ++- .../Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php | 3 ++- .../Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php | 3 ++- 11 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php index 435b3aee4d6d7..4428ee9301e9d 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php @@ -7,6 +7,7 @@ use Magento\Sales\Model\Order\Email\Sender; use Magento\Sales\Model\Order\Creditmemo\SenderInterface; +use Magento\Framework\DataObject; /** * Email notification sender for Creditmemo. @@ -106,13 +107,14 @@ public function send( 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_creditmemo_set_template_vars_before', ['sender' => $this, 'transport' => $transport] ); - $this->templateContainer->setTemplateVars($transport); + $this->templateContainer->setTemplateVars($transport->getData()); if ($this->checkAndSend($order)) { $creditmemo->setEmailSent(true); diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php index 85a607b1b2aa6..7d29fcc56aa01 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php @@ -12,6 +12,7 @@ use Magento\Sales\Model\Order\Email\NotifySender; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class CreditmemoCommentSender @@ -71,7 +72,7 @@ public function send(Creditmemo $creditmemo, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_creditmemo_comment_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php index b0fb8958515c9..f31a7e3197537 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php @@ -14,6 +14,7 @@ use Magento\Sales\Model\ResourceModel\Order\Creditmemo as CreditmemoResource; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class CreditmemoSender @@ -113,7 +114,7 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_creditmemo_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php index 76b572705c14f..202766ae38653 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php @@ -12,6 +12,7 @@ use Magento\Sales\Model\Order\Invoice; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class InvoiceCommentSender @@ -71,7 +72,7 @@ public function send(Invoice $invoice, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_invoice_comment_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php index c9037beed0a01..d51d2c6f3f32a 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php @@ -14,6 +14,7 @@ use Magento\Sales\Model\ResourceModel\Order\Invoice as InvoiceResource; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class InvoiceSender @@ -113,7 +114,7 @@ public function send(Invoice $invoice, $forceSyncMode = false) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order) ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_invoice_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php index 586bfc49bfc37..f72ac3940a7c2 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php @@ -11,6 +11,7 @@ use Magento\Sales\Model\Order\Email\NotifySender; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class OrderCommentSender @@ -68,7 +69,7 @@ public function send(Order $order, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_order_comment_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php index e98f400973c6d..2944b8ccef647 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php @@ -13,6 +13,7 @@ use Magento\Sales\Model\ResourceModel\Order as OrderResource; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class OrderSender @@ -130,7 +131,7 @@ protected function prepareTemplate(Order $order) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_order_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php index 1dcb40deac1ee..1353ea6b22dd2 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php @@ -12,6 +12,7 @@ use Magento\Sales\Model\Order\Shipment; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class ShipmentCommentSender @@ -71,7 +72,7 @@ public function send(Shipment $shipment, $notify = true, $comment = '') 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_shipment_comment_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php index e42dee71377c1..faad7255e6475 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php @@ -14,6 +14,7 @@ use Magento\Sales\Model\ResourceModel\Order\Shipment as ShipmentResource; use Magento\Sales\Model\Order\Address\Renderer; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\DataObject; /** * Class ShipmentSender @@ -113,7 +114,7 @@ public function send(Shipment $shipment, $forceSyncMode = false) 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order) ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_shipment_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php index 1924549280191..5d156722d54b6 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php @@ -7,6 +7,7 @@ use Magento\Sales\Model\Order\Email\Sender; use Magento\Sales\Model\Order\Invoice\SenderInterface; +use Magento\Framework\DataObject; /** * Email notification sender for Invoice. @@ -106,7 +107,7 @@ public function send( 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_invoice_set_template_vars_before', diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php index 31a6c289f0836..34c67f9533ed8 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php @@ -7,6 +7,7 @@ use Magento\Sales\Model\Order\Email\Sender; use Magento\Sales\Model\Order\Shipment\SenderInterface; +use Magento\Framework\DataObject; /** * Email notification sender for Shipment. @@ -106,7 +107,7 @@ public function send( 'formattedShippingAddress' => $this->getFormattedShippingAddress($order), 'formattedBillingAddress' => $this->getFormattedBillingAddress($order) ]; - $transport = new \Magento\Framework\DataObject($transport); + $transport = new DataObject($transport); $this->eventManager->dispatch( 'email_shipment_set_template_vars_before', From c32d10c15380e89d1e86e0e4752cbcf3f742666b Mon Sep 17 00:00:00 2001 From: Evgeni Obukhovsky Date: Thu, 25 May 2017 00:30:11 +0300 Subject: [PATCH 3/3] update unit tests --- .../Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php | 3 ++- .../Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php | 3 ++- .../Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php index 5b79cd26d56d7..2a8731ebf25a3 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php @@ -262,6 +262,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending 'formattedShippingAddress' => 'Formatted address', 'formattedBillingAddress' => 'Formatted address', ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManagerMock->expects($this->once()) ->method('dispatch') @@ -275,7 +276,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending $this->templateContainerMock->expects($this->once()) ->method('setTemplateVars') - ->with($transport); + ->with($transport->getData()); $this->identityContainerMock->expects($this->once()) ->method('isEnabled') diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php index dcdd04dcc5531..b1cc20ff6ea00 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php @@ -260,6 +260,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending 'formattedShippingAddress' => 'Formatted address', 'formattedBillingAddress' => 'Formatted address', ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManagerMock->expects($this->once()) ->method('dispatch') @@ -273,7 +274,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending $this->templateContainerMock->expects($this->once()) ->method('setTemplateVars') - ->with($transport); + ->with($transport->getData()); $this->identityContainerMock->expects($this->once()) ->method('isEnabled') diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php index 8226920157420..3060b950ce888 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php @@ -262,6 +262,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending 'formattedShippingAddress' => 'Formatted address', 'formattedBillingAddress' => 'Formatted address', ]; + $transport = new \Magento\Framework\DataObject($transport); $this->eventManagerMock->expects($this->once()) ->method('dispatch') @@ -275,7 +276,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending $this->templateContainerMock->expects($this->once()) ->method('setTemplateVars') - ->with($transport); + ->with($transport->getData()); $this->identityContainerMock->expects($this->once()) ->method('isEnabled')