Skip to content

Commit

Permalink
#102: added test for rewind
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGoryunov committed Aug 29, 2021
1 parent 94f0136 commit 47baa77
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/src/ArrayAddingIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,25 @@ public function testAddsValueOnlyIfItIsNotPreviouslyStored(): void
->from($source);
$this->assertEquals(1, $called->value());
}

/**
* @covers ::__construct
* @covers ::current
* @covers ::key
* @covers ::next
* @covers ::rewind
* @covers ::valid
*
* @small
*
* @return void
*/
public function testGivesSameResultsOverDifferentIterations(): void
{
$iterator = new ArrayAddingIterator([4, 3, 85, 48, 19, 53]);
$this->assertEquals(
iterator_to_array($iterator),
iterator_to_array($iterator)
);
}
}

0 comments on commit 47baa77

Please sign in to comment.