/** * @return static */ public function withAttribute() { if ($this->entity->getAttribute() !== null) { $this->entityDTO->attribute = $this->dtoBuilderFactory->getAttributeDTOBuilder($this->entity->getAttribute())->build(); } return $this; }
public function testCreateDefaults() { $attribute = $this->dummyData->getAttribute(); $attributeValue = new AttributeValue($attribute); $this->assertSame(null, $attributeValue->getSku()); $this->assertSame(null, $attributeValue->getName()); $this->assertSame(null, $attributeValue->getDescription()); $this->assertSame(null, $attributeValue->getSortOrder()); $this->assertSame($attribute, $attributeValue->getAttribute()); $this->assertSame(0, count($attributeValue->getProductAttributes())); }