You are here

function Braintree_TransactionAdvancedSearchTest::test_advancedSearchGivesIterableResult in Commerce Braintree 7

File

braintree_php/tests/integration/TransactionAdvancedSearchTest.php, line 1166

Class

Braintree_TransactionAdvancedSearchTest

Code

function test_advancedSearchGivesIterableResult() {
  $collection = Braintree_Transaction::search(array(
    Braintree_TransactionSearch::creditCardNumber()
      ->startsWith("411111"),
  ));
  $this
    ->assertTrue($collection
    ->maximumCount() > 100);
  $arr = array();
  foreach ($collection as $transaction) {
    array_push($arr, $transaction->id);
  }
  $unique_transaction_ids = array_unique(array_values($arr));
  $this
    ->assertEquals($collection
    ->maximumCount(), count($unique_transaction_ids));
}