public function __construct(Option $option, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $option; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = $this->getEntityDTO(); $this->setId(); $this->setTime(); $this->entityDTO->name = $this->entity->getname(); $this->entityDTO->description = $this->entity->getDescription(); $this->entityDTO->sortOrder = $this->entity->getSortOrder(); $this->entityDTO->type = $this->dtoBuilderFactory->getOptionTypeDTOBuilder($this->entity->getType())->build(); }
public function testCreateDefaults() { $option = new Option(); $this->assertSame(0, count($option->getTags())); $this->assertSame(0, count($option->getOptionProducts())); $this->assertSame(0, count($option->getOptionValues())); $this->assertTrue($option->getType()->isSelect()); }