public function DefaultPluginManagerTest::testGetDefinitionPluginNotFoundException in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::testGetDefinitionPluginNotFoundException()
- 9 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 138
Class
- DefaultPluginManagerTest
- Tests the DefaultPluginManager.
Namespace
Drupal\Tests\Core\PluginCode
public function testGetDefinitionPluginNotFoundException() {
$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');
}