protected function ChainedFastBackendUnitTest::createCacheBackend in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Cache/ChainedFastBackendUnitTest.php \Drupal\system\Tests\Cache\ChainedFastBackendUnitTest::createCacheBackend()
Creates a new instance of ChainedFastBackend.
Return value
\Drupal\Core\Cache\ChainedFastBackend A new ChainedFastBackend object.
Overrides GenericCacheBackendUnitTestBase::createCacheBackend
File
- core/
modules/ system/ src/ Tests/ Cache/ ChainedFastBackendUnitTest.php, line 27 - Contains \Drupal\system\Tests\Cache\ChainedFastBackendUnitTest.
Class
- ChainedFastBackendUnitTest
- Unit test of the fast chained backend using the generic cache unit test base.
Namespace
Drupal\system\Tests\CacheCode
protected function createCacheBackend($bin) {
$consistent_backend = new DatabaseBackend(\Drupal::service('database'), \Drupal::service('cache_tags.invalidator.checksum'), $bin);
$fast_backend = new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'));
$backend = new ChainedFastBackend($consistent_backend, $fast_backend, $bin);
// Explicitly register the cache bin as it can not work through the
// cache bin list in the container.
\Drupal::service('cache_tags.invalidator')
->addInvalidator($backend);
return $backend;
}