/**
  * Tests the getters and setters of the model
  * @test
  */
 public function modelToArray()
 {
     $this->assertEquals($this->sample, $this->_billingAddress->toArray());
 }
 /**
  * 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;
 }