function TaggedHandlersPassTest::testProcessNoConsumers

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\TaggedHandlersPassTest::testProcessNoConsumers()
  2. 8.9.x core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\TaggedHandlersPassTest::testProcessNoConsumers()
  3. 11.x core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\TaggedHandlersPassTest::testProcessNoConsumers()

Tests without any consumers.

@covers ::process

File

core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php, line 30

Class

TaggedHandlersPassTest
@coversDefaultClass \Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass[[api-linebreak]] @group DependencyInjection

Namespace

Drupal\Tests\Core\DependencyInjection\Compiler

Code

public function testProcessNoConsumers() : void {
  $container = $this->buildContainer();
  $container->register('consumer_id', __NAMESPACE__ . '\\ValidConsumer');
  $handler_pass = new TaggedHandlersPass();
  $handler_pass->process($container);
  $this->assertCount(2, $container->getDefinitions());
  $this->assertFalse($container->getDefinition('consumer_id')
    ->hasMethodCall('addHandler'));
}

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