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::setParams
  */
 public function testSetParams()
 {
     $expected = [uniqid()];
     $this->object->setParams($expected);
     $result = $this->object->getParams();
     $msg = 'DbException::setParams() wrong behavior!';
     $this->assertSame($expected, $result, $msg);
 }