Ouzo\Utilities\Iterator\BatchingIteratorTest::shouldRewindIterator PHP Метод

shouldRewindIterator() публичный Метод

    public function shouldRewindIterator()
    {
        $ait = new ArrayIterator(array('a', 'b', 'c', 'd'));
        $ait->next();
        $ait->next();
        $batchIterator = new BatchingIterator($ait, 2);
        //when
        $batchIterator->rewind();
        //then
        $this->assertEquals(array(array('a', 'b'), array('c', 'd')), iterator_to_array($batchIterator));
    }