function Braintree_AddressTest::testCreate_withValidationErrors_onCountryCodes in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ AddressTest.php, line 52
Class
Code
function testCreate_withValidationErrors_onCountryCodes() {
$customer = Braintree_Customer::createNoValidate();
$result = Braintree_Address::create(array(
'customerId' => $customer->id,
'countryCodeAlpha2' => 'ZZ',
));
$this
->assertFalse($result->success);
$countryErrors = $result->errors
->forKey('address')
->onAttribute('countryCodeAlpha2');
$this
->assertEquals(Braintree_Error_Codes::ADDRESS_COUNTRY_CODE_ALPHA2_IS_NOT_ACCEPTED, $countryErrors[0]->code);
}