39 $this->registry = $this->getMockBuilder(\
Magento\Framework\Registry::class)
40 ->disableOriginalConstructor()
43 $this->helperAddress = $this->getMockBuilder(\
Magento\Customer\Helper\Address::class)
44 ->disableOriginalConstructor()
55 $customerAddressId = 1;
57 $address = $this->getMockBuilder(\
Magento\Customer\Model\Address::class)
58 ->disableOriginalConstructor()
62 ->willReturn($customerAddressId);
65 ->disableOriginalConstructor()
71 ->method(
'getCustomerAddress')
74 $this->registry->expects($this->once())
78 $this->registry->expects($this->once())
79 ->method(
'unregister')
82 $this->registry->expects($this->once())
101 $customerAddressId =
null;
103 $address = $this->getMockBuilder(\
Magento\Customer\Model\Address::class)
104 ->disableOriginalConstructor()
105 ->setMethods([
'getId',
'getIsDefaultBilling',
'getIsDefaultShipping',
'setForceProcess'])
109 ->willReturn($customerAddressId);
111 ->method(
'getIsDefaultBilling')
112 ->willReturn($isDefaultBilling);
114 ->method(
'getIsDefaultShipping')
115 ->willReturn($isDefaultShipping);
117 ->method(
'setForceProcess')
122 ->disableOriginalConstructor()
124 'getCustomerAddress',
128 ->method(
'getCustomerAddress')
131 $this->helperAddress->expects($this->once())
132 ->method(
'getTaxCalculationAddressType')
133 ->willReturn($configAddressType);
135 $this->registry->expects($this->once())
139 $this->registry->expects($this->once())
140 ->method(
'unregister')
143 $this->registry->expects($this->any())
161 'isDefaultBilling' =>
true,
162 'isDefaultShipping' =>
false,
166 'isDefaultBilling' =>
false,
167 'isDefaultShipping' =>
true,
dataProviderBeforeAddressSaveWithoutCustomerAddressId()
testBeforeAddressSaveWithCustomerAddressId()
testBeforeAddressSaveWithoutCustomerAddressId( $configAddressType, $isDefaultBilling, $isDefaultShipping)
const VIV_CURRENTLY_SAVED_ADDRESS