function DatabaseBackendTagTest::register

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

Overrides KernelTestBase::register

File

core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php, line 28

Class

DatabaseBackendTagTest
Tests DatabaseBackend cache tag implementation.

Namespace

Drupal\KernelTests\Core\Cache

Code

public function register(ContainerBuilder $container) {
    parent::register($container);
    // Change container to database cache backends.
    $container->register('cache_factory', 'Drupal\\Core\\Cache\\CacheFactory')
        ->addArgument(new Reference('settings'))
        ->addMethodCall('setContainer', [
        new Reference('service_container'),
    ]);
}

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