Ejemplo n.º 1
0
 public function testConstructor()
 {
     $e = new NeevoException($m = 'error', $c = 0, $s = 'SELECT * FROM error', $p = new Exception());
     $this->assertEquals($m, $e->getMessage());
     $this->assertEquals($c, $e->getCode());
     $this->assertEquals($p, $e->getPrevious());
     $this->assertEquals($s, $e->getSql());
 }
Ejemplo n.º 2
0
 /**
  * Renders SQL query string to Nette debug bluescreen when available.
  * @param NeevoException $e
  * @return array
  */
 public function renderException($e)
 {
     if (!($e instanceof NeevoException && $e->getSql())) {
         return;
     }
     list($file, $line) = $this->failedQuerySource;
     return array('tab' => 'SQL', 'panel' => Manager::highlightSql($e->getSql()) . '<p><b>File:</b> ' . Helpers::editorLink($file, $line) . " &nbsp; <b>Line:</b> {$line}</p>" . ($line ? BlueScreen::highlightFile($file, $line) : '') . 'Neevo v' . Manager::VERSION);
 }