コード例 #1
0
 public function testCreateByIdThrowsExceptionWhenInvalid()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     ShipmentCarrierType::createById(999);
 }
コード例 #2
0
 /**
  * @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);
 }