You are here

public function RedisLockTest::register in Redis 8

Registers test-specific services.

Extend this method in your test to register additional services. This method is called whenever the kernel is rebuilt.

Parameters

\Drupal\Core\DependencyInjection\ContainerBuilder $container: The service container to enhance.

Overrides KernelTestBase::register

See also

\Drupal\Tests\KernelTestBase::bootKernel()

File

tests/src/Kernel/RedisLockTest.php, line 33

Class

RedisLockTest
Tests the Redis non-persistent lock backend.

Namespace

Drupal\Tests\redis\Kernel

Code

public function register(ContainerBuilder $container) {
  self::setUpSettings();
  parent::register($container);
  $container
    ->register('lock', LockBackendInterface::class)
    ->setFactory([
    new Reference('redis.lock.factory'),
    'get',
  ]);
}