public function testGetItemById() { $cart1 = $this->setupCart(); $cartItem1 = $cart1->getCartItems()[0]; $cartItem = $this->cartRepository->getItemById($cartItem1->getId()); $this->assertEntitiesEqual($cartItem1, $cartItem); }
/** * @param UuidInterface $cartItemId * @throws EntityNotFoundException */ public function deleteItem(UuidInterface $cartItemId) { $cartItem = $this->cartRepository->getItemById($cartItemId); $cart = $cartItem->getCart(); $cart->setShipmentRate(null); $cart->deleteCartItem($cartItem); $this->cartRepository->update($cart); }