/** * @return static */ public function withProduct() { $product = $this->entity->getProduct(); if ($product !== null) { $this->entityDTO->product = $this->dtoBuilderFactory->getProductDTOBuilder($product)->build(); } return $this; }
public function testCreate() { $product = $this->dummyData->getProduct(); $attribute = $this->dummyData->getAttribute(); $attributeValue = $this->dummyData->getAttributeValue(); $productAttribute = new ProductAttribute($product, $attribute, $attributeValue); $this->assertSame($product, $productAttribute->getProduct()); $this->assertSame($attribute, $productAttribute->getAttribute()); $this->assertSame($attributeValue, $productAttribute->getAttributeValue()); }