/**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->_billingAddress = new BillingAddress();
     $this->_billingAddress->setName($this->sample['name'])->setStreetAddress($this->sample['street_address'])->setStreetAddressAddition($this->sample['street_address_addition'])->setCity($this->sample['city'])->setState($this->sample['state'])->setPostalCode($this->sample['postal_code'])->setCountry($this->sample['country'])->setPhone($this->sample['phone']);
 }
Exemplo n.º 2
0
 /**
  * Creates and fills a shipping- / billing address model.
  *
  * @param array $response
  * @param string $type
  * @return null|BillingAddress|ShippingAddress
  */
 private function _createAddress(array $response, $type)
 {
     switch ($type) {
         case AbstractAddress::TYPE_SHIPPING:
             $model = new ShippingAddress();
             break;
         case AbstractAddress::TYPE_BILLING:
             $model = new BillingAddress();
             break;
         default:
             return null;
     }
     $model->setName($response[AbstractAddress::FIELD_NAME])->setStreetAddress($response[AbstractAddress::FIELD_STREET_ADDRESS])->setStreetAddressAddition($response[AbstractAddress::FIELD_STREET_ADDRESS_ADDITION])->setPostalCode($response[AbstractAddress::FIELD_POSTAL_CODE])->setCity($response[AbstractAddress::FIELD_CITY])->setState($response[AbstractAddress::FIELD_STATE])->setCountry($response[AbstractAddress::FIELD_COUNTRY])->setPhone($response[AbstractAddress::FIELD_PHONE]);
     return $model;
 }