You are here

function simpletest_clean_environment in SimpleTest 8.3

Same name and namespace in other branches
  1. 6.2 simpletest.module \simpletest_clean_environment()
  2. 6 simpletest.module \simpletest_clean_environment()
  3. 7.2 simpletest.module \simpletest_clean_environment()
  4. 7 simpletest.module \simpletest_clean_environment()

Removes all temporary database tables and directories.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Access the environment_cleaner service and call its cleanEnvironment() method, or use \Drupal\Core\Test\EnvironmentCleaner::cleanEnvironment() instead.

See also

https://www.drupal.org/node/3076634

1 call to simpletest_clean_environment()
DeprecatedCleanupTest::testDeprecatedCleanFunctions in tests/src/Kernel/DeprecatedCleanupTest.php
@expectedDeprecation simpletest_clean_environment is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Access the environment_cleaner service and call its cleanEnvironment() method, or use…
1 string reference to 'simpletest_clean_environment'
SimpletestTestForm::buildForm in src/Form/SimpletestTestForm.php
Form constructor.

File

./simpletest.module, line 611
Provides testing functionality.

Code

function simpletest_clean_environment() {
  @trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Access the environment_cleaner service and call its cleanEnvironment() method, or use \\Drupal\\Core\\Test\\EnvironmentCleaner::cleanEnvironment() instead.. See https://www.drupal.org/node/3076634', E_USER_DEPRECATED);

  /* @var $cleaner \Drupal\simpletest\EnvironmentCleanerService */
  $cleaner = \Drupal::service('environment_cleaner');
  $cleaner
    ->cleanEnvironment();
}