class BackendChainTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Cache/BackendChainTest.php \Drupal\KernelTests\Core\Cache\BackendChainTest

Unit test of the backend chain using the generic cache unit test base.

@group Cache

Hierarchy

Expanded class hierarchy of BackendChainTest

File

core/tests/Drupal/KernelTests/Core/Cache/BackendChainTest.php, line 13

Namespace

Drupal\KernelTests\Core\Cache
View source
class BackendChainTest extends GenericCacheBackendUnitTestBase {
  protected function createCacheBackend($bin) {
    $chain = new BackendChain();
    // We need to create some various backends in the chain.
    $chain->appendBackend(new MemoryBackend())
      ->prependBackend(new MemoryBackend())
      ->appendBackend(new MemoryBackend());
    \Drupal::service('cache_tags.invalidator')->addInvalidator($chain);
    return $chain;
  }

}

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