You are here

protected function PluginTypeManagerTest::assertPluginTypeIntegrity in Plugin 8.2

Asserts the integrity of a plugin type based on its definition.

Parameters

string $plugin_type_id:

mixed[] $plugin_type_definition:

\Drupal\Component\Plugin\PluginManagerInterface $plugin_manager:

mixed $plugin_type:

1 call to PluginTypeManagerTest::assertPluginTypeIntegrity()
PluginTypeManagerTest::testGetPluginTypes in tests/src/Unit/PluginType/PluginTypeManagerTest.php
@covers ::getPluginTypes

File

tests/src/Unit/PluginType/PluginTypeManagerTest.php, line 293

Class

PluginTypeManagerTest
@coversDefaultClass \Drupal\plugin\PluginType\PluginTypeManager

Namespace

Drupal\Tests\plugin\Unit\PluginType

Code

protected function assertPluginTypeIntegrity($plugin_type_id, $plugin_type_definition, PluginManagerInterface $plugin_manager, $plugin_type) {
  $this
    ->assertInstanceOf(PluginTypeInterface::class, $plugin_type);
  $this
    ->assertSame($plugin_type_id, $plugin_type
    ->getId());
  $this
    ->assertSame($plugin_type_definition['label'], $plugin_type
    ->getLabel()
    ->getUntranslatedString());
  $this
    ->assertSame($plugin_type_definition['description'], $plugin_type
    ->getDescription()
    ->getUntranslatedString());
  $this
    ->assertSame($plugin_type_definition['provider'], $plugin_type
    ->getProvider());
  $this
    ->assertSame($plugin_manager, $plugin_type
    ->getPluginManager());
}