Exemplo n.º 1
0
 /**
  * Throw DbException with query info
  *
  * @param string        $sql
  * @param array         $params
  * @param \PDOException $e
  *
  * @throws DbException
  */
 protected function throwExceptionWithInfo($sql, array $params, \PDOException $e)
 {
     $exception = new DbException($e->getMessage(), (int) $e->getCode(), $e);
     $exception->setSql($sql);
     $exception->setParams($params);
     throw $exception;
 }
 /**
  * @covers Veles\DataBase\Exceptions\DbException::setSql
  */
 public function testSetSql()
 {
     $expected = uniqid();
     $this->object->setSql($expected);
     $result = $this->object->getSql();
     $msg = 'DbException::setSql() wrong behavior!';
     $this->assertSame($expected, $result, $msg);
 }