You are here

function Braintree_TransactionAdvancedSearchTest::test_noRequestsWhenIterating in Commerce Braintree 7

File

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

Class

Braintree_TransactionAdvancedSearchTest

Code

function test_noRequestsWhenIterating() {
  $resultsReturned = false;
  $collection = Braintree_Transaction::search(array(
    Braintree_TransactionSearch::billingFirstName()
      ->is('thisnameisnotreal'),
  ));
  foreach ($collection as $transaction) {
    $resultsReturned = true;
    break;
  }
  $this
    ->assertSame(0, $collection
    ->maximumCount());
  $this
    ->assertEquals(false, $resultsReturned);
}