function EndOfTransactionQueriesTest::register

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

Overrides KernelTestBase::register

File

core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php, line 51

Class

EndOfTransactionQueriesTest
Tests delaying of cache tag invalidation queries to the end of transactions.

Namespace

Drupal\KernelTests\Core\Cache

Code

public function register(ContainerBuilder $container) {
    parent::register($container);
    $container->register('serializer', PhpSerialize::class);
    // Register a database cache backend rather than memory-based.
    $container->register('cache_factory', DatabaseBackendFactory::class)
        ->addArgument(new Reference('database'))
        ->addArgument(new Reference('cache_tags.invalidator.checksum'))
        ->addArgument(new Reference('settings'))
        ->addArgument(new Reference('serializer'))
        ->addArgument(new Reference(TimeInterface::class));
}

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