function DefaultPluginManagerTest::testGetDefinitionPluginNotFoundException
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::testGetDefinitionPluginNotFoundException()
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::testGetDefinitionPluginNotFoundException()
- 11.x core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::testGetDefinitionPluginNotFoundException()
Tests the plugin manager behavior for a missing plugin ID.
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ DefaultPluginManagerTest.php, line 142
Class
- DefaultPluginManagerTest
- Tests the DefaultPluginManager.
Namespace
Drupal\Tests\Core\PluginCode
public function testGetDefinitionPluginNotFoundException() : void {
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions);
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage('The "missing" plugin does not exist. Valid plugin IDs for Drupal\\Tests\\Core\\Plugin\\TestPluginManager are: apple, banana');
$plugin_manager->getDefinition('missing');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.