function TaggedHandlersPassTest::testProcessMissingInterface
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\TaggedHandlersPassTest::testProcessMissingInterface()
- 10 core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\TaggedHandlersPassTest::testProcessMissingInterface()
- 11.x core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php \Drupal\Tests\Core\DependencyInjection\Compiler\TaggedHandlersPassTest::testProcessMissingInterface()
Tests consumer with missing interface in non-production environment.
@covers ::process
File
-
core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ Compiler/ TaggedHandlersPassTest.php, line 89
Class
- TaggedHandlersPassTest
- @coversDefaultClass \Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass @group DependencyInjection
Namespace
Drupal\Tests\Core\DependencyInjection\CompilerCode
public function testProcessMissingInterface() {
$container = $this->buildContainer();
$container->register('consumer_id0', __NAMESPACE__ . '\\ValidConsumer')
->addTag('service_collector');
$container->register('consumer_id1', __NAMESPACE__ . '\\InvalidConsumer')
->addTag('service_collector');
$handler_pass = new TaggedHandlersPass();
$this->expectException(LogicException::class);
$this->expectExceptionMessage("Service consumer 'consumer_id1' class method Drupal\\Tests\\Core\\DependencyInjection\\Compiler\\InvalidConsumer::addHandler() has to type-hint an interface.");
$handler_pass->process($container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.