/** * Implementation of SeekableIterator. * @param int $offset * @throws OutOfRangeException|DriverException */ public function seek($offset) { try { $this->result->seek($offset); } catch (DriverException $e) { throw $e; } catch (NeevoException $e) { throw new OutOfRangeException("Cannot seek to offset {$offset}.", null, $e); } $this->row = $this->result->fetch(); $this->pointer = $offset; }
public function testSeekOverflow() { $this->setExpectedException('Neevo\\NeevoException', 'Cannot seek to offset'); $this->result->seek(5); }