You are here

function Braintree_TransactionTest::test_countryValidationError_inconsistency in Commerce Braintree 7

File

braintree_php/tests/integration/TransactionTest.php, line 708

Class

Braintree_TransactionTest

Code

function test_countryValidationError_inconsistency() {
  $result = Braintree_Transaction::sale(array(
    'amount' => '100.00',
    'creditCard' => array(
      'number' => '5105105105105100',
      'expirationDate' => '05/12',
    ),
    'billing' => array(
      'countryCodeAlpha2' => 'AS',
      'countryCodeAlpha3' => 'USA',
    ),
  ));
  $this
    ->assertFalse($result->success);
  $errors = $result->errors
    ->forKey('transaction')
    ->forKey('billing')
    ->onAttribute('base');
  $this
    ->assertEquals(Braintree_Error_Codes::ADDRESS_INCONSISTENT_COUNTRY, $errors[0]->code);
}