You are here

protected function CoreServiceProvider::registerTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/CoreServiceProvider.php \Drupal\Core\CoreServiceProvider::registerTest()

Registers services and event subscribers for a site under test.

1 call to CoreServiceProvider::registerTest()
CoreServiceProvider::register in core/lib/Drupal/Core/CoreServiceProvider.php
Registers services to the container.

File

core/lib/Drupal/Core/CoreServiceProvider.php, line 135
Contains \Drupal\Core\CoreServiceProvider.

Class

CoreServiceProvider
ServiceProvider class for mandatory core services.

Namespace

Drupal\Core

Code

protected function registerTest(ContainerBuilder $container) {

  // Do nothing if we are not in a test environment.
  if (!drupal_valid_test_ua()) {
    return;
  }

  // Add the HTTP request middleware to Guzzle.
  $container
    ->register('test.http_client.middleware', 'Drupal\\Core\\Test\\HttpClientMiddleware\\TestHttpClientMiddleware')
    ->addTag('http_client_middleware');
}