function SimpletestTestRunResultsStorage::setDatabasePrefix
Same name in other branches
- 11.x core/lib/Drupal/Core/Test/SimpletestTestRunResultsStorage.php \Drupal\Core\Test\SimpletestTestRunResultsStorage::setDatabasePrefix()
Overrides TestRunResultsStorageInterface::setDatabasePrefix
File
-
core/
lib/ Drupal/ Core/ Test/ SimpletestTestRunResultsStorage.php, line 68
Class
- SimpletestTestRunResultsStorage
- Implements a test run results storage compatible with legacy Simpletest.
Namespace
Drupal\Core\TestCode
public function setDatabasePrefix(TestRun $test_run, string $database_prefix) : void {
$affected_rows = $this->connection
->update('simpletest_test_id')
->fields([
'last_prefix' => $database_prefix,
])
->condition('test_id', $test_run->id())
->execute();
if (!$affected_rows) {
throw new \RuntimeException('Failed to set up database prefix.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.