protected function DatabaseStorageExpirableTest::tearDown

Deletes created files, database tables, and reverts all environment changes.

This method needs to be invoked for both unit and integration tests.

Overrides TestBase::tearDown

See also

TestBase::prepareDatabasePrefix()

TestBase::changeDatabasePrefix()

TestBase::prepareEnvironment()

File

drupal/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php, line 43
Contains Drupal\system\Tests\KeyValueStore\DatabaseStorageExpirableTest.

Class

DatabaseStorageExpirableTest
Tests the key-value database storage.

Namespace

Drupal\system\Tests\KeyValueStore

Code

protected function tearDown() {

  // The DatabaseExpirableStorage class has a destructor which deletes rows
  // from the key_value_expire table. We need to make sure the destructor
  // runs before the table is deleted.
  $this->container
    ->set('keyvalue.expirable', NULL);
  db_drop_table('key_value_expire');
  parent::tearDown();
}