You are here

public function ExtraFieldDisplayPluginTest::testDisplayPlugin in Extra Field 8.2

Tests display basic plugins.

@covers \Drupal\extra_field\Plugin\ExtraFieldDisplayBase::view

@dataProvider displayPluginProvider

Parameters

string $pluginId: Plugin ID of the plugin under test.

array $output: Plugin output as returned by ::view.

File

tests/src/Kernel/ExtraFieldDisplayPluginTest.php, line 85

Class

ExtraFieldDisplayPluginTest
Kernel test for Extra Field display plugins.

Namespace

Drupal\Tests\extra_field\Kernel

Code

public function testDisplayPlugin($pluginId, array $output) {
  switch ($pluginId) {
    case 'all_node_types_test':
      $extraField = new AllNodeTypesTest([], $pluginId, []);
      break;
  }
  $pluginOutput = $extraField
    ->view($this->node);
  unset($pluginOutput['#object']);
  unset($pluginOutput['#items']);
  $this
    ->assertEquals($output, $pluginOutput);
}