Example #1
0
 public function testAfterAddressSave()
 {
     $this->moduleManagerMock->expects($this->once())->method('isEnabled')->with('Magento_PageCache')->willReturn(true);
     $this->cacheConfigMock->expects($this->once())->method('isEnabled')->willReturn(true);
     $this->weeeHelperMock->expects($this->any())->method('isEnabled')->willReturn(true);
     $address = $this->objectManager->getObject('Magento\\Customer\\Model\\Address');
     $address->setIsDefaultShipping(true);
     $address->setIsDefaultBilling(true);
     $address->setIsPrimaryBilling(true);
     $address->setIsPrimaryShipping(true);
     $address->setCountryId(1);
     $address->setData('postcode', 11111);
     $this->customerSessionMock->expects($this->once())->method('setDefaultTaxBillingAddress')->with(['country_id' => 1, 'region_id' => null, 'postcode' => 11111]);
     $this->customerSessionMock->expects($this->once())->method('setDefaultTaxShippingAddress')->with(['country_id' => 1, 'region_id' => null, 'postcode' => 11111]);
     $this->observerMock->expects($this->once())->method('getCustomerAddress')->willReturn($address);
     $this->session->afterAddressSave($this->observerMock);
 }