/** * @Then /^there should be no shipments with ("[^"]+" shipping method) in the registry$/ */ public function shipmentShouldNotExistInTheRegistry(ShippingMethodInterface $shippingMethod) { $shippings = $this->shipmentRepository->findBy(['method' => $shippingMethod]); expect($shippings)->toBe([]); }
/** * @Then /^there should be no shipments with ("[^"]+" shipping method) in the registry$/ */ public function shipmentShouldNotExistInTheRegistry(ShippingMethodInterface $shippingMethod) { $shippings = $this->shipmentRepository->findBy(['method' => $shippingMethod]); Assert::same($shippings, []); }
function it_throws_an_exception_if_shipment_still_exist(ShipmentRepositoryInterface $shippingRepository, ShippingMethodInterface $dhlShipmentMethod, ShipmentInterface $shipment) { $shippingRepository->findBy(['method' => $dhlShipmentMethod])->willReturn([$shipment]); $this->shouldThrow(NotEqualException::class)->during('shipmentShouldNotExistInTheRegistry', [$dhlShipmentMethod]); }