You are here

protected function RedisCacheTest::createCacheBackend in Redis 8

Creates a new instance of PhpRedis cache backend.

Return value

\Drupal\redis\Cache\PhpRedis A new PhpRedis cache backend.

Overrides GenericCacheBackendUnitTestBase::createCacheBackend

File

tests/src/Kernel/RedisCacheTest.php, line 43

Class

RedisCacheTest
Tests Redis cache backend using GenericCacheBackendUnitTestBase.

Namespace

Drupal\Tests\redis\Kernel

Code

protected function createCacheBackend($bin) {
  $cache = \Drupal::service('cache.backend.redis')
    ->get($bin);
  $cache
    ->setMinTtl(10);
  return $cache;
}