You are here

function ServiceContainerAnnotationDiscoveryIntegrationTest::testPluginManagerKey in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_annotation_discovery/lib/Drupal/service_container_annotation_discovery/Tests/ServiceContainerAnnotationDiscoveryIntegrationTest.php \Drupal\service_container_annotation_discovery\Tests\ServiceContainerAnnotationDiscoveryIntegrationTest::testPluginManagerKey()

Tests plugin_manager_name key in definition.

File

modules/providers/service_container_annotation_discovery/lib/Drupal/service_container_annotation_discovery/Tests/ServiceContainerAnnotationDiscoveryIntegrationTest.php, line 129
Contains \Drupal\service_container_annotation_discovery\Tests\ServiceContainerBlockIntegrationTest.

Class

ServiceContainerAnnotationDiscoveryIntegrationTest

Namespace

Drupal\service_container_annotation_discovery\Tests

Code

function testPluginManagerKey() {
  $plugins = array(
    array(
      'plugin_manager_name' => 'drupal8ftw',
      'name' => 'Plugin5A',
    ),
  );
  foreach ($plugins as $plugin) {
    $plugin_manager = $this->container
      ->get($plugin['plugin_manager_name']);
    $this
      ->assertTrue($plugin_manager
      ->hasDefinition($plugin['name']));
    $object = $plugin_manager
      ->createInstance($plugin['name']);
    $this
      ->assertTrue($object instanceof PluginBase);
  }
}