You are here

function Braintree_TransactionTest::testSale_withInvalidTaxAmountAttribute in Commerce Braintree 7

File

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

Class

Braintree_TransactionTest

Code

function testSale_withInvalidTaxAmountAttribute() {
  $result = Braintree_Transaction::sale(array(
    'amount' => '100.00',
    'creditCard' => array(
      'cardholderName' => 'The Cardholder',
      'expirationDate' => '05/2011',
      'number' => '5105105105105100',
    ),
    'taxAmount' => 'abc',
  ));
  $this
    ->assertFalse($result->success);
  $taxAmountErrors = $result->errors
    ->forKey('transaction')
    ->onAttribute('taxAmount');
  $this
    ->assertEquals(Braintree_Error_Codes::TRANSACTION_TAX_AMOUNT_FORMAT_IS_INVALID, $taxAmountErrors[0]->code);
}