Ouzo\Utilities\Iterator\FluentIteratorTest::shouldCycleIndefinitely PHP Method

shouldCycleIndefinitely() public method

    public function shouldCycleIndefinitely()
    {
        //given
        $iterator = new \ArrayIterator(array(1, 2, 3, 4));
        //when
        $result = FluentIterator::from($iterator)->cycle()->limit(10)->reindex();
        //then
        $this->assertEquals(array(1, 2, 3, 4, 1, 2, 3, 4, 1, 2), $result->toArray());
    }