You are here

function Braintree_CustomerAdvancedSearchTest::test_noRequestsWhenIterating in Commerce Braintree 7

File

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

Class

Braintree_CustomerAdvancedSearchTest

Code

function test_noRequestsWhenIterating() {
  $resultsReturned = false;
  $collection = Braintree_Customer::search(array(
    Braintree_CustomerSearch::firstName()
      ->is('badname'),
  ));
  foreach ($collection as $customer) {
    $resultsReturned = true;
    break;
  }
  $this
    ->assertSame(0, $collection
    ->maximumCount());
  $this
    ->assertEquals(false, $resultsReturned);
}