You are here

function Braintree_CreditCardTest::testUpdateNoValidate_throwsIfInvalid in Commerce Braintree 7

File

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

Class

Braintree_CreditCardTest

Code

function testUpdateNoValidate_throwsIfInvalid() {
  $customer = Braintree_Customer::createNoValidate();
  $creditCard = Braintree_CreditCard::createNoValidate(array(
    'customerId' => $customer->id,
    'cardholderName' => 'Old Cardholder',
    'number' => '5105105105105100',
    'expirationDate' => '05/12',
  ));
  $this
    ->setExpectedException('Braintree_Exception_ValidationsFailed');
  Braintree_CreditCard::updateNoValidate($creditCard->token, array(
    'number' => 'invalid',
  ));
}