function PhpBackendTest::createCacheBackend

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php \Drupal\KernelTests\Core\Cache\PhpBackendTest::createCacheBackend()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php \Drupal\KernelTests\Core\Cache\PhpBackendTest::createCacheBackend()
  3. 11.x core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php \Drupal\KernelTests\Core\Cache\PhpBackendTest::createCacheBackend()

Creates a new instance of MemoryBackend.

Return value

\Drupal\Core\Cache\CacheBackendInterface A new PhpBackend object.

Overrides GenericCacheBackendUnitTestBase::createCacheBackend

File

core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php, line 23

Class

PhpBackendTest
Unit test of the PHP cache backend using the generic cache unit test base.

Namespace

Drupal\KernelTests\Core\Cache

Code

protected function createCacheBackend($bin) {
    return new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'), \Drupal::service(TimeInterface::class));
}

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