function ExceptionLoggingSubscriberTest::register

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php \Drupal\KernelTests\Core\EventSubscriber\ExceptionLoggingSubscriberTest::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/EventSubscriber/ExceptionLoggingSubscriberTest.php, line 84

Class

ExceptionLoggingSubscriberTest
Tests that HTTP exceptions are logged correctly.

Namespace

Drupal\KernelTests\Core\EventSubscriber

Code

public function register(ContainerBuilder $container) {
  parent::register($container);
  $container->register($this->testLogServiceName, BufferingLogger::class)
    ->addTag('logger');
}

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