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

testNextWithWhile() public method

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