You are here

function Braintree_CreditCardTest::testUpdateNoValidate in Commerce Braintree 7

File

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

Class

Braintree_CreditCardTest

Code

function testUpdateNoValidate() {
  $customer = Braintree_Customer::createNoValidate();
  $creditCard = Braintree_CreditCard::createNoValidate(array(
    'customerId' => $customer->id,
    'cardholderName' => 'Old Cardholder',
    'number' => '5105105105105100',
    'expirationDate' => '05/12',
  ));
  $updatedCard = Braintree_CreditCard::updateNoValidate($creditCard->token, array(
    'cardholderName' => 'New Cardholder',
    'number' => '4111111111111111',
    'expirationDate' => '07/14',
  ));
  $this
    ->assertEquals($customer->id, $updatedCard->customerId);
  $this
    ->assertEquals('411111', $updatedCard->bin);
  $this
    ->assertEquals('1111', $updatedCard->last4);
  $this
    ->assertEquals('New Cardholder', $updatedCard->cardholderName);
  $this
    ->assertEquals('07/2014', $updatedCard->expirationDate);
}