You are here

public function DefaultPluginManagerTest::testCreateInstanceWithJustValidInterfaces in Drupal 10

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

Tests plugins with the proper interface.

@covers ::createInstance

File

core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php, line 275

Class

DefaultPluginManagerTest
Tests the DefaultPluginManager.

Namespace

Drupal\Tests\Core\Plugin

Code

public function testCreateInstanceWithJustValidInterfaces() {
  $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, NULL, NULL, '\\Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\FruitInterface');
  foreach ($this->expectedDefinitions as $plugin_id => $definition) {
    $this
      ->assertNotNull($plugin_manager
      ->createInstance($plugin_id));
  }
}