Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 3
0
 public function getWarehouse($num = 1)
 {
     $warehouse = new Warehouse();
     $warehouse->setName('Test Warehouse #' . $num);
     $warehouse->setAddress($this->getAddress());
     return $warehouse;
 }