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); }