You are here

function simpletest_clean_environment in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/simpletest.module \simpletest_clean_environment()

Removes all temporary database tables and directories.

1 call to simpletest_clean_environment()
simpletest_uninstall in core/modules/simpletest/simpletest.install
Implements hook_uninstall().
1 string reference to 'simpletest_clean_environment'
SimpletestTestForm::buildForm in core/modules/simpletest/src/Form/SimpletestTestForm.php
Form constructor.

File

core/modules/simpletest/simpletest.module, line 571
Provides testing functionality.

Code

function simpletest_clean_environment() {
  simpletest_clean_database();
  simpletest_clean_temporary_directories();
  if (\Drupal::config('simpletest.settings')
    ->get('clear_results')) {
    $count = simpletest_clean_results_table();
    drupal_set_message(\Drupal::translation()
      ->formatPlural($count, 'Removed 1 test result.', 'Removed @count test results.'));
  }
  else {
    drupal_set_message(t('Clear results is disabled and the test results table will not be cleared.'), 'warning');
  }

  // Detect test classes that have been added, renamed or deleted.
  \Drupal::cache()
    ->delete('simpletest');
  \Drupal::cache()
    ->delete('simpletest_phpunit');
}