lithium\tests\integration\data\source\database\adapter\pdo\ResultTest::testResultForeach PHP Method

testResultForeach() public method

Test that a Result object can be used in a foreach loop
public testResultForeach ( )
    public function testResultForeach()
    {
        $result = $this->_db->read('SELECT name, active FROM galleries', array('return' => 'resource'));
        $rows = array();
        foreach ($result as $row) {
            $rows[] = $row;
        }
        $expected = array(array('Foo Gallery', null), array('Bar Gallery', null));
        $this->assertEqual($expected, $rows);
    }