/**
  * @return static
  */
 public function withCartItemOptionProducts(PricingInterface $pricing)
 {
     foreach ($this->entity->getCartItemOptionProducts() as $cartItemOptionProduct) {
         $this->entityDTO->cartItemOptionProducts[] = $this->dtoBuilderFactory->getCartItemOptionProductDTOBuilder($cartItemOptionProduct)->withOptionProduct($pricing)->build();
     }
     return $this;
 }
Esempio n. 2
0
 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()));
 }