function FieldStorageCreateCheckDeprecationTest::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/Field/FieldStorageCreateCheckDeprecationTest.php, line 34

Class

FieldStorageCreateCheckDeprecationTest
Tests the field storage create check subscriber.

Namespace

Drupal\KernelTests\Core\Field

Code

public function register(ContainerBuilder $container) : void {
  parent::register($container);
  // Change the service to act like this is a non-core test.
  $container->register('testing.field_storage_create_check', FieldStorageCreateCheckSubscriber::class)
    ->addArgument(new Reference('database'))
    ->addArgument(new Reference('entity_type.manager'))
    ->addArgument(FALSE)
    ->addTag('event_subscriber');
}

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