You are here

public function ContentNegotiationRoutingTest::containerBuild in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php \Drupal\system\Tests\Routing\ContentNegotiationRoutingTest::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/Routing/ContentNegotiationRoutingTest.php, line 41
Contains \Drupal\system\Tests\Routing\ContentNegotiationRoutingTest.

Class

ContentNegotiationRoutingTest
Tests content negotiation routing variations.

Namespace

Drupal\system\Tests\Routing

Code

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

  // \Drupal\simpletest\KernelTestBase::containerBuild() removes the alias path
  // processor.
  if ($container
    ->hasDefinition('path_processor_alias')) {
    $definition = $container
      ->getDefinition('path_processor_alias');
    $definition
      ->addTag('path_processor_inbound', [
      'priority' => 100,
    ])
      ->addTag('path_processor_outbound', [
      'priority' => 300,
    ]);
  }
}