function SimpletestTestRunResultsStorage::removeResults

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

Overrides TestRunResultsStorageInterface::removeResults

File

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

Class

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

Namespace

Drupal\Core\Test

Code

public function removeResults(TestRun $test_run) : int {
    $this->connection
        ->startTransaction('delete_test_run');
    $this->connection
        ->delete('simpletest')
        ->condition('test_id', $test_run->id())
        ->execute();
    $count = $this->connection
        ->delete('simpletest_test_id')
        ->condition('test_id', $test_run->id())
        ->execute();
    return $count;
}

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