You are here

protected function GenericCacheBackendUnitTestBase::tearDown in Drupal 8

Same name in this branch
  1. 8 core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::tearDown()
  2. 8 core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php \Drupal\system\Tests\Cache\GenericCacheBackendUnitTestBase::tearDown()

Performs cleanup tasks after each individual test method has been run.

Overrides KernelTestBase::tearDown

File

core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php, line 118

Class

GenericCacheBackendUnitTestBase
Tests any cache backend.

Namespace

Drupal\system\Tests\Cache

Code

protected function tearDown() {

  // Destruct the registered backend, each test will get a fresh instance,
  // properly emptying it here ensure that on persistent 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();
}