/** * @return static */ public function withCartItemOptionValues() { foreach ($this->entity->getCartItemOptionValues() as $cartItemOptionValue) { $this->entityDTO->cartItemOptionValues[] = $this->dtoBuilderFactory->getCartItemOptionValueDTOBuilder($cartItemOptionValue)->build(); } return $this; }
public function testCreateDefaults() { $cartItem = new CartItem(); $this->assertSame(null, $cartItem->getQuantity()); $this->assertSame(null, $cartItem->getProduct()); $this->assertSame(null, $cartItem->getCart()); $this->assertSame(0, count($cartItem->getCartItemOptionProducts())); $this->assertSame(0, count($cartItem->getCartItemOptionValues())); $this->assertSame(0, count($cartItem->getCartItemTextOptionValues())); $this->assertSame(0, count($cartItem->getAttachments())); }