function ImageStyleCustomStreamWrappersTest::register

Same name and namespace in other branches
  1. 8.9.x core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php \Drupal\Tests\image\Kernel\ImageStyleCustomStreamWrappersTest::register()
  2. 10 core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php \Drupal\Tests\image\Kernel\ImageStyleCustomStreamWrappersTest::register()
  3. 11.x 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

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,
        ]);
    }
}

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