You are here

function Braintree_AddressTest::testUpdateNoValidate in Commerce Braintree 7

File

braintree_php/tests/integration/AddressTest.php, line 236

Class

Braintree_AddressTest

Code

function testUpdateNoValidate() {
  $customer = Braintree_Customer::createNoValidate();
  $createdAddress = Braintree_Address::createNoValidate(array(
    'customerId' => $customer->id,
    'firstName' => 'Old First',
    'lastName' => 'Old Last',
    'company' => 'Old Company',
    'streetAddress' => '1 E Old St',
    'extendedAddress' => 'Apt Old',
    'locality' => 'Old Chicago',
    'region' => 'Old Region',
    'postalCode' => 'Old Postal',
    'countryName' => 'United States of America',
  ));
  $address = Braintree_Address::updateNoValidate($customer->id, $createdAddress->id, array(
    'firstName' => 'New First',
    'lastName' => 'New Last',
    'company' => 'New Company',
    'streetAddress' => '1 E New St',
    'extendedAddress' => 'Apt New',
    'locality' => 'New Chicago',
    'region' => 'New Region',
    'postalCode' => 'New Postal',
    'countryName' => 'Mexico',
  ));
  $this
    ->assertEquals('New First', $address->firstName);
  $this
    ->assertEquals('New Last', $address->lastName);
  $this
    ->assertEquals('New Company', $address->company);
  $this
    ->assertEquals('1 E New St', $address->streetAddress);
  $this
    ->assertEquals('Apt New', $address->extendedAddress);
  $this
    ->assertEquals('New Chicago', $address->locality);
  $this
    ->assertEquals('New Region', $address->region);
  $this
    ->assertEquals('New Postal', $address->postalCode);
  $this
    ->assertEquals('Mexico', $address->countryName);
}