You are here

public function ViewModeFieldFormatterTest::testViewModeFieldFormatter in Entity Embed 8

Tests view mode entity embed display.

File

tests/src/Functional/ViewModeFieldFormatterTest.php, line 30

Class

ViewModeFieldFormatterTest
Tests the view mode entity embed display provided by entity_embed.

Namespace

Drupal\Tests\entity_embed\Functional

Code

public function testViewModeFieldFormatter() {

  // Ensure that view mode plugins have no configuration form.
  foreach ($this->plugins as $plugin) {
    $form = [];
    $form_state = new FormState();
    $display = $this->container
      ->get('plugin.manager.entity_embed.display')
      ->createInstance($plugin, []);
    $display
      ->setContextValue('entity', $this->node);
    $conf_form = $display
      ->buildConfigurationForm($form, $form_state);
    $this
      ->assertSame([], array_keys($conf_form));
  }
}