You are here

protected function WidgetTestTrait::updateWidgetSettingField in The CodeMirror Editor 8

Sets a value for a given settings field.

1 call to WidgetTestTrait::updateWidgetSettingField()
WidgetTestTrait::testWidgetEditor in tests/src/FunctionalJavascript/WidgetTestTrait.php
Test callback.

File

tests/src/FunctionalJavascript/WidgetTestTrait.php, line 208

Class

WidgetTestTrait
Provides a helper methods to for testing widgets.

Namespace

Drupal\Tests\codemirror_editor\FunctionalJavascript

Code

protected function updateWidgetSettingField($name, $value) {
  $page = $this
    ->getSession()
    ->getPage();
  $field_name = "fields[{$this->fieldName}][settings_edit_form][settings][{$name}]";
  if (is_bool($value)) {
    $value ? $page
      ->checkField($field_name) : $page
      ->uncheckField($field_name);
  }
  else {
    $page
      ->fillField($field_name, $value);
  }
}