You are here

public function MultipleSelectsPostUpdateAddElementTypeToWidgets::testPostUpdateAddConfigurationFormOptionToWidget in Multiple Selects 8

Check if the element type was added to the widget settings.

See also

multiple_selects_post_update_add_element_type_to_widgets()

File

tests/src/Functional/Update/MultipleSelectsPostUpdateAddElementTypeToWidgets.php, line 52

Class

MultipleSelectsPostUpdateAddElementTypeToWidgets
Update test that checks if the element type was added to the widget settings.

Namespace

Drupal\Tests\multiple_selects\Functional\Update

Code

public function testPostUpdateAddConfigurationFormOptionToWidget() {

  /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $entity_form_display */
  $entity_form_display = $this->entityFormDisplayStorage
    ->loadUnchanged('node.page.default');
  $this
    ->assertArrayNotHasKey('element_type', $entity_form_display
    ->getComponent('uid')['settings']);
  $this
    ->runUpdates();
  $entity_form_display = $this->entityFormDisplayStorage
    ->loadUnchanged('node.page.default');
  $this
    ->assertEquals('select', $entity_form_display
    ->getComponent('uid')['settings']['element_type']);
}