lithium\tests\cases\data\CollectionTest::testNextRewindCurrent PHP Method

testNextRewindCurrent() public method

Tests Collection::rewind and Collection::current.
    public function testNextRewindCurrent()
    {
        $collection = new MockCollection(array('data' => array('title' => 'Lorem Ipsum', 'value' => 42, 'foo' => 'bar')));
        $this->assertEqual('Lorem Ipsum', $collection->current());
        $this->assertEqual(42, $collection->next());
        $this->assertEqual('bar', $collection->next());
        $this->assertEqual('Lorem Ipsum', $collection->rewind());
        $this->assertEqual(42, $collection->next());
    }