current_row == 5) { return false; } else { $this->current_row++; return array('name' => 'Fred', 'age' => 10, 'id' => '1'); } } } /** * Another mock PDOStatement class, used for testing multiple connections */ class MockDifferentPDOStatement extends MockPDOStatement { } /** * * Mock database class implementing a subset * of the PDO API. * */ class MockPDO extends PDO { /** * Return a dummy PDO statement */ public function prepare($statement, $driver_options=array()) { $this->last_query = new MockPDOStatement($statement); return $this->last_query; } } /** * A different mock database class, for testing multiple connections * Mock database class implementing a subset of the PDO API. */ class MockDifferentPDO extends MockPDO { /** * Return a dummy PDO statement */ public function prepare($statement, $driver_options = array()) { $this->last_query = new MockDifferentPDOStatement($statement); return $this->last_query; } }