function MemoryBackendTest::createCacheBackend
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php \Drupal\KernelTests\Core\Cache\MemoryBackendTest::createCacheBackend()
- 8.9.x core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php \Drupal\KernelTests\Core\Cache\MemoryBackendTest::createCacheBackend()
- 11.x core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php \Drupal\KernelTests\Core\Cache\MemoryBackendTest::createCacheBackend()
Creates a new instance of MemoryBackend.
Return value
\Drupal\Core\Cache\CacheBackendInterface A new MemoryBackend object.
Overrides GenericCacheBackendUnitTestBase::createCacheBackend
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Cache/ MemoryBackendTest.php, line 23
Class
- MemoryBackendTest
- Unit test of the memory cache backend using the generic cache unit test base.
Namespace
Drupal\KernelTests\Core\CacheCode
protected function createCacheBackend($bin) {
$backend = new MemoryBackend(\Drupal::service(TimeInterface::class));
\Drupal::service('cache_tags.invalidator')->addInvalidator($backend);
return $backend;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.