You are here

public function EnvironmentCleanerService::cleanDatabase in Drupal 8

Remove database entries left over in the fixture database.

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\simpletest

Code

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.'));
  }
}