1 backdrop_web_test_case.php protected BackdropUnitTestCase::tearDown()

Clean up any database tables, configuration, or files after each test run.

Overrides BackdropTestCase::tearDown

File

core/modules/simpletest/backdrop_web_test_case.php, line 895

Class

BackdropUnitTestCase
Test case for Backdrop unit tests.

Code

protected function tearDown() {
  global $conf, $language;

  // Get back to the original connection.
  Database::removeConnection('default');
  Database::renameConnection('simpletest_original_default', 'default');

  // Delete the database table prefix record.
  db_delete('simpletest_prefix')
    ->condition('test_id', $this->testId)
    ->condition('prefix', $this->databasePrefix)
    ->execute();

  $conf['file_public_path'] = $this->originalFileDirectory;
  // Restore modules if necessary.
  if (isset($this->originalModuleList)) {
    module_list(TRUE, FALSE, FALSE, $this->originalModuleList);
  }

  // Reset language.
  $language = $this->originalLanguage;
}