Skip to content

Commit e1fc8be

Browse files
committed
Simplify generator setup in tests
1 parent d4144e4 commit e1fc8be

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/Model/CachingIteratorTest.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testIterationWithEmptySet()
5353

5454
public function testPartialIterationDoesNotExhaust()
5555
{
56-
$traversable = $this->getTraversableThatThrows([1, 2, new Exception()]);
56+
$traversable = $this->getTraversable([1, 2, new Exception()]);
5757
$iterator = new CachingIterator($traversable);
5858

5959
$expectedKey = 0;
@@ -110,13 +110,6 @@ public function testCountWithEmptySet()
110110
}
111111

112112
private function getTraversable($items)
113-
{
114-
foreach ($items as $item) {
115-
yield $item;
116-
}
117-
}
118-
119-
private function getTraversableThatThrows($items)
120113
{
121114
foreach ($items as $item) {
122115
if ($item instanceof Exception) {

0 commit comments

Comments
 (0)