Example #1
0
 public function testCreateDefaults()
 {
     $product = new Product();
     $this->assertTrue($product->getId() instanceof UuidInterface);
     $this->assertTrue($product->getCreated() instanceof DateTime);
     $this->assertSame(null, $product->getSku());
     $this->assertSame(null, $product->getName());
     $this->assertSame(null, $product->getDescription());
     $this->assertSame(null, $product->getDefaultImage());
     $this->assertSame(0, $product->getUnitPrice());
     $this->assertSame(0, $product->getQuantity());
     $this->assertSame(0, $product->getShippingWeight());
     $this->assertSame(null, $product->getRating());
     $this->assertFalse($product->isInventoryRequired());
     $this->assertFalse($product->isPriceVisible());
     $this->assertFalse($product->isActive());
     $this->assertFalse($product->isVisible());
     $this->assertFalse($product->isTaxable());
     $this->assertFalse($product->isShippable());
     $this->assertSame(0, count($product->getTags()));
     $this->assertSame(0, count($product->getImages()));
     $this->assertSame(0, count($product->getProductQuantityDiscounts()));
     $this->assertSame(0, count($product->getOptionProducts()));
     $this->assertSame(0, count($product->getProductAttributes()));
 }
 /**
  * @return static
  */
 public function withOptionProducts()
 {
     foreach ($this->entity->getOptionProducts() as $optionProduct) {
         $this->entityDTO->optionProducts[] = $this->dtoBuilderFactory->getOptionProductDTOBuilder($optionProduct)->withOption()->build();
     }
     return $this;
 }