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 <a href="/api/drupal/core%21lib%21Drupal%21Core%21DependencyInjection%21Compiler%21TaggedHandlersPass.php/class/TaggedHandlersPass/10" title="Collects services to add/inject them into a consumer service." class="local">\Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass</a> @group DependencyInjection

Namespace

Drupal\Tests\Core\DependencyInjection\Compiler

Code

public function testProcessNoConsumers() {
    $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.