public function GenericCacheBackendUnitTestBase::tearDown

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

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

Overrides DrupalUnitTestBase::tearDown

See also

TestBase::prepareDatabasePrefix()

TestBase::changeDatabasePrefix()

TestBase::prepareEnvironment()

File

drupal/core/modules/system/lib/Drupal/system/Tests/Cache/GenericCacheBackendUnitTestBase.php, line 119
Definition of Drupal\system\Tests\Cache\GenericCacheBackendUnitTestBase.

Class

GenericCacheBackendUnitTestBase
Tests any cache backend.

Namespace

Drupal\system\Tests\Cache

Code

public function tearDown() {

  // Destruct the registered backend, each test will get a fresh instance,
  // properly emptying it here ensure that on persistant data backends they
  // will come up empty the next test.
  foreach ($this->cachebackends as $bin => $cachebackend) {
    $this->cachebackends[$bin]
      ->deleteAll();
  }
  unset($this->cachebackends);
  $this
    ->tearDownCacheBackend();
  parent::tearDown();
}