function GenericCacheBackendUnitTestBase::tearDown

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::tearDown()
  2. 8.9.x core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php \Drupal\system\Tests\Cache\GenericCacheBackendUnitTestBase::tearDown()
  3. 8.9.x core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::tearDown()
  4. 10 core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::tearDown()

Overrides KernelTestBase::tearDown

1 call to GenericCacheBackendUnitTestBase::tearDown()
ApcuBackendTest::tearDown in core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
1 method overrides GenericCacheBackendUnitTestBase::tearDown()
ApcuBackendTest::tearDown in core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php

File

core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php, line 121

Class

GenericCacheBackendUnitTestBase
Tests any cache backend.

Namespace

Drupal\KernelTests\Core\Cache

Code

protected function tearDown() : void {
    // 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 => $cache_backend) {
        $this->cacheBackends[$bin]
            ->deleteAll();
    }
    unset($this->cacheBackends);
    $this->tearDownCacheBackend();
    parent::tearDown();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.