function Braintree_AddressTest::testCreate in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ AddressTest.php, line 6
Class
Code
function testCreate() {
$customer = Braintree_Customer::createNoValidate();
$result = Braintree_Address::create(array(
'customerId' => $customer->id,
'firstName' => 'Dan',
'lastName' => 'Smith',
'company' => 'Braintree',
'streetAddress' => '1 E Main St',
'extendedAddress' => 'Apt 1F',
'locality' => 'Chicago',
'region' => 'IL',
'postalCode' => '60622',
'countryName' => 'Vatican City',
'countryCodeAlpha2' => 'VA',
'countryCodeAlpha3' => 'VAT',
'countryCodeNumeric' => '336',
));
$this
->assertTrue($result->success);
$address = $result->address;
$this
->assertEquals('Dan', $address->firstName);
$this
->assertEquals('Smith', $address->lastName);
$this
->assertEquals('Braintree', $address->company);
$this
->assertEquals('1 E Main St', $address->streetAddress);
$this
->assertEquals('Apt 1F', $address->extendedAddress);
$this
->assertEquals('Chicago', $address->locality);
$this
->assertEquals('IL', $address->region);
$this
->assertEquals('60622', $address->postalCode);
$this
->assertEquals('Vatican City', $address->countryName);
$this
->assertEquals('VA', $address->countryCodeAlpha2);
$this
->assertEquals('VAT', $address->countryCodeAlpha3);
$this
->assertEquals('336', $address->countryCodeNumeric);
}