You are here

function Braintree_CreditCardTest::testSaleNoValidate_throwsIfInvalid in Commerce Braintree 7

File

braintree_php/tests/integration/CreditCardTest.php, line 453

Class

Braintree_CreditCardTest

Code

function testSaleNoValidate_throwsIfInvalid() {
  $customer = Braintree_Customer::createNoValidate(array(
    'creditCard' => array(
      'number' => '5105105105105100',
      'expirationDate' => '05/12',
    ),
  ));
  $creditCard = $customer->creditCards[0];
  $this
    ->setExpectedException('Braintree_Exception_ValidationsFailed');
  Braintree_CreditCard::saleNoValidate($creditCard->token, array(
    'amount' => 'invalid',
  ));
}