You are here

public function ImageStyleCustomStreamWrappersTest::register in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php \Drupal\Tests\image\Kernel\ImageStyleCustomStreamWrappersTest::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

See also

\Drupal\Tests\KernelTestBase::bootKernel()

File

core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php, line 57

Class

ImageStyleCustomStreamWrappersTest
Tests derivative generation with source images using stream wrappers.

Namespace

Drupal\Tests\image\Kernel

Code

public function register(ContainerBuilder $container) {
  parent::register($container);
  foreach ($this
    ->providerTestCustomStreamWrappers() as $stream_wrapper) {
    $scheme = $stream_wrapper[0];
    $class = $stream_wrapper[2];
    $container
      ->register("stream_wrapper.{$scheme}", $class)
      ->addTag('stream_wrapper', [
      'scheme' => $scheme,
    ]);
  }
}