25 $this->paymentHelper = $this->createPartialMock(\
Magento\
Payment\Helper\Data::class, [
'getInfoBlockHtml']);
31 $this->addressRenderer->expects($this->any())->method(
'format')->willReturn(1);
33 $this->invoiceMock = $this->createPartialMock(
35 [
'getStore',
'__wakeup',
'getOrder']
37 $this->invoiceMock->expects($this->any())
39 ->will($this->returnValue($this->storeMock));
40 $this->invoiceMock->expects($this->any())
42 ->will($this->returnValue($this->orderMock));
45 $this->templateContainerMock,
46 $this->identityContainerMock,
47 $this->senderBuilderFactoryMock,
49 $this->addressRenderer,
50 $this->eventManagerMock
57 $result = $this->sender->send($this->invoiceMock);
65 $comment =
'comment_test';
66 $this->orderMock->expects($this->once())
67 ->method(
'getCustomerIsGuest')
68 ->will($this->returnValue(
false));
69 $this->identityContainerMock->expects($this->once())
71 ->will($this->returnValue(
true));
72 $this->templateContainerMock->expects($this->once())
73 ->method(
'setTemplateVars')
77 'order' => $this->orderMock,
78 'invoice' => $this->invoiceMock,
79 'comment' => $comment,
81 'store' => $this->storeMock,
82 'formattedShippingAddress' => 1,
83 'formattedBillingAddress' => 1
89 $result = $this->sender->send($this->invoiceMock,
true, $comment);
97 $comment =
'comment_test';
98 $this->orderMock->expects($this->once())
99 ->method(
'getCustomerIsGuest')
100 ->will($this->returnValue(
false));
102 $this->identityContainerMock->expects($this->once())
103 ->method(
'isEnabled')
104 ->will($this->returnValue(
true));
105 $this->templateContainerMock->expects($this->once())
106 ->method(
'setTemplateVars')
110 'order' => $this->orderMock,
111 'invoice' => $this->invoiceMock,
113 'comment' => $comment,
114 'store' => $this->storeMock,
115 'formattedShippingAddress' => 1,
116 'formattedBillingAddress' => 1
121 $result = $this->sender->send($this->invoiceMock,
false, $comment);
127 $isVirtualOrder =
true;
131 $this->identityContainerMock->expects($this->once())
132 ->method(
'isEnabled')
133 ->will($this->returnValue(
false));
134 $this->templateContainerMock->expects($this->once())
135 ->method(
'setTemplateVars')
139 'order' => $this->orderMock,
140 'invoice' => $this->invoiceMock,
141 'billing' => $this->addressMock,
143 'store' => $this->storeMock,
144 'formattedShippingAddress' =>
null,
145 'formattedBillingAddress' => 1
149 $this->assertFalse($this->sender->send($this->invoiceMock));
stepSendWithCallSendCopyTo()
stepIdentityContainerInit($identityMockClassName)
stepSendWithoutSendCopy()
stepAddressFormat($billingAddress, $isVirtual=false)