You are here

public function RePublishDependencyChangesTest::register in Acquia Content Hub 8.2

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/RePublishDependencyChangesTest.php, line 62

Class

RePublishDependencyChangesTest
Tests that entities whose depcalc cache got invalidated are republished.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

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'),
  ]);
}