public function __construct(AttributeValue $attributeValue, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $attributeValue; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = new AttributeValueDTO(); $this->setId(); $this->setTime(); $this->entityDTO->sku = $this->entity->getSku(); $this->entityDTO->name = $this->entity->getName(); $this->entityDTO->description = $this->entity->getDescription(); $this->entityDTO->sortOrder = $this->entity->getSortOrder(); }
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())); }