protected function Tasks::runTestQuery

Run SQL tests to ensure the database can execute commands with the current user.

File

drupal/core/lib/Drupal/Core/Database/Install/Tasks.php, line 179
Definition of Drupal\Core\Database\Install\Tasks

Class

Tasks
Database installer structure.

Namespace

Drupal\Core\Database\Install

Code

protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) {
  try {
    db_query($query);
    $this
      ->pass(st($pass));
  } catch (Exception $e) {
    $this
      ->fail(st($fail, array(
      '%query' => $query,
      '%error' => $e
        ->getMessage(),
      '%name' => $this
        ->name(),
    )));
    return !$fatal;
  }
}