79 $this->senderMock = $this->createPartialMock(
81 [
'send',
'sendCopyTo']
84 $this->senderBuilderFactoryMock = $this->createPartialMock(
85 \
Magento\Sales\Model\
Order\Email\SenderBuilderFactory::class,
88 $this->templateContainerMock = $this->createPartialMock(
89 \
Magento\Sales\Model\
Order\Email\Container\Template::class,
93 $this->storeMock = $this->createPartialMock(\
Magento\Store\Model\Store::class, [
'getStoreId',
'__wakeup']);
95 $this->orderMock = $this->createPartialMock(\
Magento\Sales\Model\Order::class, [
96 'getStore',
'getBillingAddress',
'getPayment',
97 '__wakeup',
'getCustomerIsGuest',
'getCustomerName',
98 'getCustomerEmail',
'getShippingAddress',
'setSendEmail',
101 $this->orderMock->expects($this->any())
103 ->will($this->returnValue($this->storeMock));
104 $paymentInfoMock = $this->createMock(\
Magento\
Payment\Model\Info::class);
105 $this->orderMock->expects($this->any())
106 ->method(
'getPayment')
107 ->will($this->returnValue($paymentInfoMock));
109 $this->addressRenderer = $this->createMock(\
Magento\Sales\Model\
Order\
Address\Renderer::class);
110 $this->addressMock = $this->createMock(\
Magento\Sales\Model\
Order\Address::class);
111 $this->eventManagerMock = $this->createMock(\
Magento\Framework\Event\Manager::class);
113 $this->paymentHelper = $this->createPartialMock(\
Magento\
Payment\Helper\Data::class, [
'getInfoBlockHtml']);
114 $this->paymentHelper->expects($this->any())
115 ->method(
'getInfoBlockHtml')
116 ->will($this->returnValue(
'payment'));
118 $this->globalConfig = $this->createPartialMock(\
Magento\Framework\
App\Config::class, [
'getValue']);
120 $this->loggerMock = $this->createMock(\Psr\Log\LoggerInterface::class);
129 $this->orderMock->expects($this->any())
130 ->method(
'getBillingAddress')
133 $this->orderMock->expects($this->never())
134 ->method(
'getShippingAddress');
136 $this->orderMock->expects($this->once())
137 ->method(
'getShippingAddress')
144 $this->
stepSend($this->once(), $this->never());
149 $this->
stepSend($this->never(), $this->once());
157 $this->identityContainerMock = $this->createPartialMock(
158 $identityMockClassName,
159 [
'getStore',
'isEnabled',
'getConfigValue',
'getTemplateId',
'getGuestTemplateId']
161 $this->identityContainerMock->expects($this->any())
163 ->will($this->returnValue($this->storeMock));
171 \PHPUnit\Framework\MockObject\Matcher\InvokedCount $sendExpects,
172 \PHPUnit\Framework\MockObject\Matcher\InvokedCount $sendCopyToExpects
174 $senderMock = $this->createPartialMock(\
Magento\Sales\Model\
Order\Email\Sender::class, [
'send',
'sendCopyTo']);
178 ->method(
'sendCopyTo');
180 $this->senderBuilderFactoryMock->expects($this->once())
stepSend(\PHPUnit\Framework\MockObject\Matcher\InvokedCount $sendExpects, \PHPUnit\Framework\MockObject\Matcher\InvokedCount $sendCopyToExpects)
stepSendWithCallSendCopyTo()
$senderBuilderFactoryMock
stepIdentityContainerInit($identityMockClassName)
stepSendWithoutSendCopy()
stepAddressFormat($billingAddress, $isVirtual=false)