Example #1
0
 /**
  * @magentoDataFixture Magento/Customer/_files/customer.php
  * @magentoDataFixture Magento/Customer/_files/customer_address.php
  * @magentoDataFixture Magento/Checkout/_files/quote_with_product_and_payment.php
  */
 public function testGetAddress()
 {
     $addressFromFixture = $this->_addressService->getAddress(self::FIXTURE_ADDRESS_ID);
     $address = $this->_block->getAddress();
     $this->assertEquals($addressFromFixture->getFirstname(), $address->getFirstname());
     $this->assertEquals($addressFromFixture->getLastname(), $address->getLastname());
     $this->assertEquals($addressFromFixture->getCustomerId(), $address->getCustomerId());
 }
Example #2
0
 public function testGetDefaultRateRequest()
 {
     $customerDataSet = $this->_customerAccountService->getCustomer(self::FIXTURE_CUSTOMER_ID);
     $address = $this->_addressService->getAddress(self::FIXTURE_ADDRESS_ID);
     $rateRequest = $this->_model->getRateRequest(null, null, null, null, $customerDataSet->getId());
     $this->assertNotNull($rateRequest);
     $this->assertEquals($address->getCountryId(), $rateRequest->getCountryId());
     $this->assertEquals($address->getRegion()->getRegionId(), $rateRequest->getRegionId());
     $this->assertEquals($address->getPostcode(), $rateRequest->getPostcode());
     $customerTaxClassId = $this->_groupService->getGroup($customerDataSet->getGroupId())->getTaxClassId();
     $this->assertEquals($customerTaxClassId, $rateRequest->getCustomerClassId());
 }