function simpletest_uninstall

Same name in other branches
  1. 7.x modules/simpletest/simpletest.install \simpletest_uninstall()
  2. 9 core/modules/simpletest/simpletest.install \simpletest_uninstall()

Implements hook_uninstall().

File

core/modules/simpletest/simpletest.install, line 95

Code

function simpletest_uninstall() {
    // Do not clean the environment in case the Simpletest module is uninstalled
    // in a (recursive) test for itself, since simpletest_clean_environment()
    // would also delete the test site of the parent test process.
    if (!drupal_valid_test_ua()) {
        \Drupal::service('environment_cleaner')->cleanEnvironment();
    }
    // Delete verbose test output and any other testing framework files.
    try {
        \Drupal::service('file_system')->deleteRecursive('public://simpletest');
    } catch (FileException $e) {
        // Ignore.
    }
}

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