Ejemplo n.º 1
0
 public function testCreate()
 {
     $orderAddress = new OrderAddress();
     $orderAddress->setFirstName('John');
     $orderAddress->setLastName('Doe');
     $orderAddress->setCompany('Acme Co.');
     $orderAddress->setAddress1('123 Any St');
     $orderAddress->setAddress2('Ste 3');
     $orderAddress->setCity('Santa Monica');
     $orderAddress->setState('CA');
     $orderAddress->setZip5('90401');
     $orderAddress->setZip4('3274');
     $orderAddress->setPhone('555-123-4567');
     $orderAddress->setEmail('*****@*****.**');
     $orderAddress->setCountry('US');
     $orderAddress->setIsResidential(false);
     $this->assertEntityValid($orderAddress);
     $this->assertSame('John', $orderAddress->getFirstName());
     $this->assertSame('Doe', $orderAddress->getLastName());
     $this->assertSame('Acme Co.', $orderAddress->getCompany());
     $this->assertSame('123 Any St', $orderAddress->getAddress1());
     $this->assertSame('Ste 3', $orderAddress->getAddress2());
     $this->assertSame('Santa Monica', $orderAddress->getCity());
     $this->assertSame('CA', $orderAddress->getState());
     $this->assertSame('90401', $orderAddress->getZip5());
     $this->assertSame('3274', $orderAddress->getZip4());
     $this->assertSame('555-123-4567', $orderAddress->getPhone());
     $this->assertSame('*****@*****.**', $orderAddress->getEmail());
     $this->assertSame('US', $orderAddress->getCountry());
     $this->assertFalse($orderAddress->isResidential());
 }
 /**
  * @param OrderAddressDTO $orderAddressDTO
  * @return OrderAddress
  */
 public static function createFromDTO(OrderAddressDTO $orderAddressDTO)
 {
     $orderAddress = new OrderAddress();
     $orderAddress->setFirstName($orderAddressDTO->firstName);
     $orderAddress->setLastName($orderAddressDTO->lastName);
     $orderAddress->setCompany($orderAddressDTO->company);
     $orderAddress->setAddress1($orderAddressDTO->address1);
     $orderAddress->setAddress2($orderAddressDTO->address2);
     $orderAddress->setCity($orderAddressDTO->city);
     $orderAddress->setState($orderAddressDTO->state);
     $orderAddress->setZip5($orderAddressDTO->zip5);
     $orderAddress->setZip4($orderAddressDTO->zip4);
     $orderAddress->setPhone($orderAddressDTO->phone);
     $orderAddress->setEmail($orderAddressDTO->email);
     $orderAddress->setCountry($orderAddressDTO->country);
     $orderAddress->setIsResidential($orderAddressDTO->isResidential);
     return $orderAddress;
 }
Ejemplo n.º 3
0
 public function getOrderAddress()
 {
     $orderAddress = new OrderAddress();
     $orderAddress->setFirstName('John');
     $orderAddress->setLastName('Doe');
     $orderAddress->setCompany('Acme Co.');
     $orderAddress->setAddress1('123 Any St');
     $orderAddress->setAddress2('Ste 3');
     $orderAddress->setCity('Santa Monica');
     $orderAddress->setState('CA');
     $orderAddress->setZip5('90401');
     $orderAddress->setZip4('3274');
     $orderAddress->setPhone('555-123-4567');
     $orderAddress->setEmail('*****@*****.**');
     $orderAddress->setCountry('US');
     $orderAddress->setIsResidential(true);
     return $orderAddress;
 }