public function __construct(TextOption $textOption, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $textOption; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = new TextOptionDTO(); $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->getTextOptionTypeDTOBuilder($this->entity->getType())->build(); }
public function testCreateDefaults() { $textOption = new TextOption(); $this->assertSame(null, $textOption->getName()); $this->assertSame(null, $textOption->getDescription()); $this->assertSame(0, $textOption->getSortOrder()); $this->assertSame(0, count($textOption->getTags())); $this->assertTrue($textOption->getType()->isText()); }