You are here

function Braintree_CreditCardTest::testDelete_deletesThePaymentMethod in Commerce Braintree 7

File

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

Class

Braintree_CreditCardTest

Code

function testDelete_deletesThePaymentMethod() {
  $customer = Braintree_Customer::createNoValidate(array());
  $creditCard = Braintree_CreditCard::createNoValidate(array(
    'customerId' => $customer->id,
    'number' => '5105105105105100',
    'expirationDate' => '05/12',
  ));
  Braintree_CreditCard::find($creditCard->token);
  Braintree_CreditCard::delete($creditCard->token);
  $this
    ->setExpectedException('Braintree_Exception_NotFound');
  Braintree_CreditCard::find($creditCard->token);
}