Пример #1
0
 public function testFindByZip5AndStateWithZip5()
 {
     $taxRate1 = $this->dummyData->getTaxRate();
     $this->taxRateRepository->shouldReceive('findByZip5AndState')->with($taxRate1->getZip5(), null)->andReturn($taxRate1)->once();
     $taxRate = $this->taxRateService->findByZip5AndState($taxRate1->getZip5());
     $this->assertEntitiesEqual($taxRate1, $taxRate);
 }
Пример #2
0
 public function testSetExternalShipmentRate()
 {
     $cart = $this->getCartThatRepositoryWillFind();
     $this->cartRepositoryShouldUpdateOnce($cart);
     $orderAddressDTO = new OrderAddressDTO();
     $orderAddressDTO->zip5 = self::ZIP5;
     $taxRate = $this->dummyData->getTaxRate();
     $this->taxRateRepository->shouldReceive('findByZip5AndState')->with(self::ZIP5, null)->andReturn($taxRate)->once();
     $this->cartService->setExternalShipmentRate($cart->getId(), self::SHIPMENT_RATE_EXTERNAL_ID, $orderAddressDTO);
     $this->assertSame(self::SHIPMENT_RATE_EXTERNAL_ID, $cart->getShipmentRate()->getShipmentExternalId());
     $this->assertSame(self::ZIP5, $cart->getShippingAddress()->getZip5());
 }