You are here

public function DatabaseBackendTagTest::containerBuild in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php \Drupal\system\Tests\Cache\DatabaseBackendTagTest::containerBuild()

Sets up the base service container for this test.

Extend this method in your test to register additional service overrides that need to persist a DrupalKernel reboot. This method is called whenever the kernel is rebuilt.

Overrides KernelTestBase::containerBuild

See also

\Drupal\simpletest\KernelTestBase::setUp()

\Drupal\simpletest\KernelTestBase::enableModules()

\Drupal\simpletest\KernelTestBase::disableModules()

File

core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php, line 32
Contains \Drupal\system\Tests\Cache\DatabaseBackendTagTest.

Class

DatabaseBackendTagTest
Tests DatabaseBackend cache tag implementation.

Namespace

Drupal\system\Tests\Cache

Code

public function containerBuild(ContainerBuilder $container) {
  parent::containerBuild($container);

  // Change container to database cache backends.
  $container
    ->register('cache_factory', 'Drupal\\Core\\Cache\\CacheFactory')
    ->addArgument(new Reference('settings'))
    ->addMethodCall('setContainer', array(
    new Reference('service_container'),
  ));
}