27 $this->customerAddressHelperMock = $this->getMockBuilder(\
Magento\Customer\Helper\Address::class)
28 ->disableOriginalConstructor()
32 $this->customerAddressHelperMock
49 $this->customerAddressHelperMock->expects($this->once())
50 ->method(
'getTaxCalculationAddressType')
51 ->will($this->returnValue($configAddressType));
53 $orderAddressMock = $this->createPartialMock(
54 \
Magento\Sales\Model\Order\Address::class,
55 [
'getVatRequestId',
'getVatRequestDate',
'__wakeup']
57 $orderAddressMock->expects($this->any())
58 ->method(
'getVatRequestId')
59 ->will($this->returnValue($vatRequestId));
60 $orderAddressMock->expects($this->any())
61 ->method(
'getVatRequestDate')
62 ->will($this->returnValue($vatRequestDate));
64 $orderMock = $this->getMockBuilder(\
Magento\Sales\Model\Order::class)
65 ->disableOriginalConstructor()
66 ->setMethods([
'getShippingAddress',
'__wakeup',
'addStatusHistoryComment',
'getBillingAddress'])
68 $orderMock->expects($this->any())
69 ->method(
'getShippingAddress')
70 ->will($this->returnValue($orderAddressMock));
71 if ($orderHistoryComment ===
null) {
72 $orderMock->expects($this->never())
73 ->method(
'addStatusHistoryComment');
75 $orderMock->expects($this->once())
76 ->method(
'addStatusHistoryComment')
77 ->with($orderHistoryComment,
false);
79 $observer = $this->createPartialMock(\
Magento\Framework\Event\Observer::class, [
'getOrder']);
82 ->will($this->returnValue($orderMock));
84 $this->assertNull($this->observer->execute(
$observer));
94 \Magento\Customer\Model\Address\AbstractAddress::TYPE_SHIPPING,
97 'VAT Request Identifier: vatRequestId<br />VAT Request Date: vatRequestDate',
100 \Magento\Customer\Model\Address\AbstractAddress::TYPE_SHIPPING,
106 \Magento\Customer\Model\Address\AbstractAddress::TYPE_SHIPPING,
118 \Magento\Customer\Model\Address\AbstractAddress::TYPE_BILLING,