You are here

function Braintree_CreditCardTest::testExpired in Commerce Braintree 7

File

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

Class

Braintree_CreditCardTest

Code

function testExpired() {
  $collection = Braintree_CreditCard::expired();
  $this
    ->assertTrue($collection
    ->maximumCount() > 1);
  $arr = array();
  foreach ($collection as $creditCard) {
    $this
      ->assertTrue($creditCard
      ->isExpired());
    array_push($arr, $creditCard->token);
  }
  $uniqueCreditCardTokens = array_unique(array_values($arr));
  $this
    ->assertEquals($collection
    ->maximumCount(), count($uniqueCreditCardTokens));
}