function EnvironmentCleaner::cleanDatabase

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Test/EnvironmentCleaner.php \Drupal\Core\Test\EnvironmentCleaner::cleanDatabase()
  2. 8.9.x core/lib/Drupal/Core/Test/EnvironmentCleaner.php \Drupal\Core\Test\EnvironmentCleaner::cleanDatabase()
  3. 11.x core/lib/Drupal/Core/Test/EnvironmentCleaner.php \Drupal\Core\Test\EnvironmentCleaner::cleanDatabase()

Remove database entries left over in the fixture database.

Overrides EnvironmentCleanerInterface::cleanDatabase

File

core/lib/Drupal/Core/Test/EnvironmentCleaner.php, line 62

Class

EnvironmentCleaner
Helper class for cleaning test environments.

Namespace

Drupal\Core\Test

Code

public function cleanDatabase() : void {
  $count = $this->doCleanDatabase();
  if ($count > 0) {
    $this->output
      ->write('Leftover tables removed: ' . $count);
  }
  else {
    $this->output
      ->write('No leftover tables to remove.');
  }
}

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