function ContentNegotiationRoutingTest::register

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php \Drupal\KernelTests\Core\Routing\ContentNegotiationRoutingTest::register()

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

File

core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php, line 37

Class

ContentNegotiationRoutingTest
Tests content negotiation routing variations.

Namespace

Drupal\KernelTests\Core\Routing

Code

public function register(ContainerBuilder $container) {
    parent::register($container);
    // \Drupal\KernelTests\KernelTestBase::register() removes the alias path
    // processor.
    if ($container->hasDefinition('path_alias.path_processor')) {
        $definition = $container->getDefinition('path_alias.path_processor');
        $definition->addTag('path_processor_inbound', [
            'priority' => 100,
        ])
            ->addTag('path_processor_outbound', [
            'priority' => 300,
        ]);
    }
}

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