public function __construct(Warehouse $warehouse, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $warehouse; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = new WarehouseDTO(); $this->setId(); $this->setTime(); $this->entityDTO->name = $this->entity->getName(); $this->entityDTO->address = $this->dtoBuilderFactory->getAddressDTOBuilder($this->entity->getAddress())->build(); }
public function testCreate() { $address = $this->dummyData->getAddress(); $warehouse = new Warehouse(); $warehouse->setName('Store Headquarters'); $warehouse->setAddress($address); $this->assertEntityValid($warehouse); $this->assertSame('Store Headquarters', $warehouse->getName()); $this->assertSame($address, $warehouse->getAddress()); }
public function getWarehouse($num = 1) { $warehouse = new Warehouse(); $warehouse->setName('Test Warehouse #' . $num); $warehouse->setAddress($this->getAddress()); return $warehouse; }