function SimpletestTestRunResultsStorage::insertLogEntry

Same name in other branches
  1. 10 core/lib/Drupal/Core/Test/SimpletestTestRunResultsStorage.php \Drupal\Core\Test\SimpletestTestRunResultsStorage::insertLogEntry()

Overrides TestRunResultsStorageInterface::insertLogEntry

File

core/lib/Drupal/Core/Test/SimpletestTestRunResultsStorage.php, line 81

Class

SimpletestTestRunResultsStorage
Implements a test run results storage compatible with legacy Simpletest.

Namespace

Drupal\Core\Test

Code

public function insertLogEntry(TestRun $test_run, array $entry) : bool {
    $entry['test_id'] = $test_run->id();
    $entry = array_merge([
        'function' => 'Unknown',
        'line' => 0,
        'file' => 'Unknown',
    ], $entry);
    return (bool) $this->connection
        ->insert('simpletest')
        ->fields($entry)
        ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.