public function getAddress() { $address = new Address(); $address->setAttention('John Doe'); $address->setCompany('Acme Co.'); $address->setAddress1('123 Any St'); $address->setAddress2('Ste 3'); $address->setCity('Santa Monica'); $address->setState('CA'); $address->setZip5('90401'); $address->setZip4('3274'); $address->setPoint($this->getPoint()); return $address; }
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 testCreate() { $point = $this->dummyData->getPoint(); $address = new Address(); $address->setAttention('John Doe'); $address->setCompany('Acme Co.'); $address->setAddress1('123 Any St'); $address->setAddress2('Ste 3'); $address->setCity('Santa Monica'); $address->setState('CA'); $address->setZip5('90401'); $address->setZip4('3274'); $address->setPoint($point); $this->assertEntityValid($address); $this->assertSame('John Doe', $address->getAttention()); $this->assertSame('Acme Co.', $address->getCompany()); $this->assertSame('123 Any St', $address->getAddress1()); $this->assertSame('Ste 3', $address->getAddress2()); $this->assertSame('Santa Monica', $address->getCity()); $this->assertSame('CA', $address->getState()); $this->assertSame('90401', $address->getZip5()); $this->assertSame('3274', $address->getZip4()); $this->assertSame($point, $address->getPoint()); }