public function __construct(Address $address, DTOBuilderFactoryInterface $dtoBuilderFactory) { $this->entity = $address; $this->dtoBuilderFactory = $dtoBuilderFactory; $this->entityDTO = new AddressDTO(); $this->entityDTO->attention = $this->entity->getAttention(); $this->entityDTO->company = $this->entity->getCompany(); $this->entityDTO->address1 = $this->entity->getaddress1(); $this->entityDTO->address2 = $this->entity->getaddress2(); $this->entityDTO->city = $this->entity->getcity(); $this->entityDTO->state = $this->entity->getstate(); $this->entityDTO->zip5 = $this->entity->getzip5(); $this->entityDTO->zip4 = $this->entity->getzip4(); $this->entityDTO->point = $this->dtoBuilderFactory->getPointDTOBuilder($this->entity->getPoint())->build(); }
public function testCreateDefaults() { $address = new Address(); $this->assertSame(null, $address->getAttention()); $this->assertSame(null, $address->getCompany()); $this->assertSame(null, $address->getAddress1()); $this->assertSame(null, $address->getAddress2()); $this->assertSame(null, $address->getCity()); $this->assertSame(null, $address->getState()); $this->assertSame(null, $address->getZip5()); $this->assertSame(null, $address->getZip4()); $point = $address->getPoint(); $this->assertEquals(0.0, $point->getLatitude(), '', FLOAT_DELTA); $this->assertEquals(0.0, $point->getLongitude(), '', FLOAT_DELTA); }