You are here

public function DefaultLazyPluginCollectionTest::testGetNotExistingPlugin in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\DefaultLazyPluginCollectionTest::testGetNotExistingPlugin()
  2. 9 core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\DefaultLazyPluginCollectionTest::testGetNotExistingPlugin()

@covers ::get

File

core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php, line 52

Class

DefaultLazyPluginCollectionTest
@coversDefaultClass \Drupal\Core\Plugin\DefaultLazyPluginCollection @group Plugin

Namespace

Drupal\Tests\Core\Plugin

Code

public function testGetNotExistingPlugin() {
  $this
    ->setupPluginCollection();
  $this
    ->expectException(PluginNotFoundException::class);
  $this
    ->expectExceptionMessage("Plugin ID 'pear' was not found.");
  $this->defaultPluginCollection
    ->get('pear');
}