function DatabaseBackendTest::createCacheBackend

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

Creates a new instance of DatabaseBackend.

Return value

\Drupal\Core\Cache\DatabaseBackend A new DatabaseBackend object.

Overrides GenericCacheBackendUnitTestBase::createCacheBackend

File

core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php, line 35

Class

DatabaseBackendTest
Unit test of the database backend using the generic cache unit test base.

Namespace

Drupal\KernelTests\Core\Cache

Code

protected function createCacheBackend($bin) {
    return new DatabaseBackend($this->container
        ->get('database'), $this->container
        ->get('cache_tags.invalidator.checksum'), $bin, $this->container
        ->get('serialization.phpserialize'), \Drupal::service(TimeInterface::class), static::$maxRows);
}

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