You are here

public function AutomaticUpdatesKernelTestBase::register in Automatic Updates 8.2

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

See also

\Drupal\Tests\KernelTestBase::bootKernel()

1 call to AutomaticUpdatesKernelTestBase::register()
CoreComposerValidatorTest::register in tests/src/Kernel/ReadinessValidation/CoreComposerValidatorTest.php
Registers test-specific services.
1 method overrides AutomaticUpdatesKernelTestBase::register()
CoreComposerValidatorTest::register in tests/src/Kernel/ReadinessValidation/CoreComposerValidatorTest.php
Registers test-specific services.

File

tests/src/Kernel/AutomaticUpdatesKernelTestBase.php, line 80

Class

AutomaticUpdatesKernelTestBase
Base class for kernel tests of the Automatic Updates module.

Namespace

Drupal\Tests\automatic_updates\Kernel

Code

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

  // If we previously set up a mock HTTP client in ::setReleaseMetadata(),
  // re-inject it into the container.
  if ($this->client) {
    $container
      ->set('http_client', $this->client);
  }

  // Disable the filesystem permissions validator, since we cannot guarantee
  // that the current code base will be writable in all testing situations. We
  // test this validator in our build tests, since those do give us control
  // over the filesystem permissions.
  // @see \Drupal\Tests\automatic_updates\Build\CoreUpdateTest::assertReadOnlyFileSystemError()
  $container
    ->removeDefinition('automatic_updates.validator.file_system_permissions');
}