lithium\tests\cases\data\collection\MultiKeyRecordSetTest::testRewindReinitialization PHP Method

testRewindReinitialization() public method

    public function testRewindReinitialization()
    {
        $counter = 0;
        while ($record = $this->_recordSet->current()) {
            $this->assertEqual($this->_records[$counter], $record->to('array'));
            $counter++;
            $this->_recordSet->next();
        }
        $this->assertEqual(4, $counter);
        $this->_recordSet->rewind();
        $counter = 0;
        while ($this->_recordSet->key() !== null) {
            $record = $this->_recordSet->current();
            $this->assertEqual($this->_records[$counter], $record->to('array'));
            $this->_recordSet->next();
            $counter++;
        }
        $this->assertEqual(4, $counter);
    }