lithium\tests\cases\data\source\ResultTest::testIterationWithPeek PHP Method

testIterationWithPeek() public method

    public function testIterationWithPeek()
    {
        $records = array("one", "two", "three", "four");
        $iterator = new MockResult(compact('records'));
        $map = array("one" => "two", "two" => "three", "three" => "four", "four" => false);
        $result = array();
        foreach ($iterator as $key => $val) {
            $result[] = $val;
            $this->assertEqual($iterator->peek(), $map[$val]);
        }
        $this->assertEqual($records, $result);
    }