/** * @return static */ public function withCartItemTextOptionValues() { foreach ($this->entity->getCartItemTextOptionValues() as $cartItemTextOptionValue) { $this->entityDTO->cartItemTextOptionValues[] = $this->dtoBuilderFactory->getCartItemTextOptionValueDTOBuilder($cartItemTextOptionValue)->withTextOption()->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())); }