Пример #1
0
 function it_deletes_an_order(SharedStorageInterface $sharedStorage, AddressInterface $shippingAddress, AddressInterface $billingAddress, AdjustmentInterface $adjustment, OrderRepositoryInterface $orderRepository, OrderInterface $order)
 {
     $orderRepository->findOneBy(['number' => '#00000000'])->willReturn($order);
     $order->getBillingAddress()->willReturn($billingAddress);
     $order->getShippingAddress()->willReturn($shippingAddress);
     $order->getAdjustments()->willReturn([$adjustment]);
     $billingAddress->getId()->willReturn(3);
     $shippingAddress->getId()->willReturn(2);
     $adjustment->getId()->willReturn(1);
     $orderRepository->remove($order)->shouldBeCalled();
     $sharedStorage->set('deleted_adjustments', [1])->shouldBeCalled();
     $sharedStorage->set('deleted_addresses', [2, 3])->shouldBeCalled();
     $this->iDeleteTheOrder('#00000000');
 }