Example #1
0
 /**
  * @see OrderEntity::setShippingAddress()
  */
 public function testSetShippingAddress()
 {
     $address = array('street1' => 'street1_' . rand(1, 1000), 'street2' => 'street2_' . rand(1, 1000), 'city' => 'city_' . rand(1, 1000), 'state' => 'state_' . rand(1, 1000), 'country' => 'country_' . rand(1, 1000), 'postalCode' => 'postalCode_' . rand(1, 1000), 'phone' => 'phone_' . rand(1, 1000));
     $shippingAddress = new ShippingAddressEntity();
     $shippingAddress->setStreet1($address['street1'])->setStreet2($address['street2'])->setCity($address['city'])->setState($address['state'])->setCountry($address['country'])->setPostalCode($address['postalCode'])->setPhone($address['phone']);
     $rs = $this->object->setShippingAddress($shippingAddress);
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\Order\\OrderEntity', $rs);
     $rs = $this->object->getShippingAddress();
     $this->assertEquals($shippingAddress->getStreet1(), $rs->getStreet1());
     $this->assertEquals($shippingAddress->getStreet2(), $rs->getStreet2());
     $this->assertEquals($shippingAddress->getCity(), $rs->getCity());
     $this->assertEquals($shippingAddress->getState(), $rs->getState());
     $this->assertEquals($shippingAddress->getCountry(), $rs->getCountry());
     $this->assertEquals($shippingAddress->getPostalCode(), $rs->getPostalCode());
     $this->assertEquals($shippingAddress->getPhone(), $rs->getPhone());
 }