Ejemplo n.º 1
0
 public function testCustomErrorMessage()
 {
     $sql = "select * from invalid_table_name";
     $statement = new Statement($sql, $this->connection);
     $statement->execute();
     $error = new Error($statement, 'my custom message');
     $actual = $error->getErrorMessage();
     $this->assertContains('my custom message', $actual);
     $actual = $statement->getErrorMessage('another message');
     $this->assertContains('another message', $actual);
 }
Ejemplo n.º 2
0
 /**
  * returns last error found
  * @param string $message    optional message to prepend
  * @return string
  */
 public function getError($message = '')
 {
     $error = new Error($this, $message);
     return $error->render();
 }