Skip to content

Commit afc9af0

Browse files
authored
Tests cleaned up a little
Removed the empty `foreach()` loops and replaced assertEquals on the array index with an `assertCount()`
1 parent a79a772 commit afc9af0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/Elasticsearch/Tests/Helper/Iterators/SearchResponseIteratorTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ public function testWithNoResults()
7878

7979
$responses = new SearchResponseIterator($mock_client, $search_params);
8080

81-
foreach ($responses as $i => $response) {
82-
}
83-
84-
$this->assertEquals(0, $i);
81+
$this->assertCount(0, $responses);
8582
}
8683

8784
public function testWithScan()
@@ -179,9 +176,6 @@ public function testWithScan()
179176

180177
$responses = new SearchResponseIterator($mock_client, $search_params);
181178

182-
foreach ($responses as $i => $response) {
183-
}
184-
185-
$this->assertEquals(2, $i);
179+
$this->assertCount(2, $responses);
186180
}
187181
}

0 commit comments

Comments
 (0)