function EnvironmentCleanerService::cleanDatabase
Overrides EnvironmentCleaner::cleanDatabase
1 call to EnvironmentCleanerService::cleanDatabase()
- EnvironmentCleanerService::cleanEnvironment in core/
modules/ simpletest/ src/ EnvironmentCleanerService.php - Removes all test-related database tables and directories.
File
-
core/
modules/ simpletest/ src/ EnvironmentCleanerService.php, line 101
Class
- EnvironmentCleanerService
- Uses containerized services to perform post-test cleanup.
Namespace
Drupal\simpletestCode
public function cleanDatabase() {
$tables_removed = $this->doCleanDatabase();
if ($tables_removed > 0) {
$this->messenger
->addMessage($this->translation
->formatPlural($tables_removed, 'Removed 1 leftover table.', 'Removed @count leftover tables.'));
}
else {
$this->messenger
->addMessage($this->translation
->translate('No leftover tables to remove.'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.