public function testCreateByIdThrowsExceptionWhenInvalid() { $this->setExpectedException(InvalidArgumentException::class); ShipmentCarrierType::createById(999); }
/** * @param UuidInterface $orderId * @param \inklabs\kommerce\EntityDTO\OrderItemQtyDTO $orderItemQtyDTO * @param string $comment * @param int $shipmentCarrierTypeId * @param string $trackingCode */ public function addShipmentTrackingCode(UuidInterface $orderId, OrderItemQtyDTO $orderItemQtyDTO, $comment, $shipmentCarrierTypeId, $trackingCode) { $order = $this->orderRepository->findOneById($orderId); $shipmentCarrierType = ShipmentCarrierType::createById($shipmentCarrierTypeId); $shipmentTracker = new ShipmentTracker($shipmentCarrierType, $trackingCode); $this->addShipment($comment, $orderItemQtyDTO, $shipmentTracker, $order); }