You are here

protected function TestBase::assertWidgetForm in Twig Field 8

Asserts widget form.

1 call to TestBase::assertWidgetForm()
TwigFieldTest::testTwigField in tests/src/FunctionalJavascript/TwigFieldTest.php
Test callback.

File

tests/src/FunctionalJavascript/TestBase.php, line 129

Class

TestBase
Base class for Twig field tests.

Namespace

Drupal\Tests\twig_field\FunctionalJavascript

Code

protected function assertWidgetForm(array $widget_settings) {
  $xpath = sprintf('//textarea[@name = "field_template[0][value]" and @rows = %d and @placeholder = "%s"]', $widget_settings['rows'], $widget_settings['placeholder']);
  $this
    ->assertSession()
    ->elementExists('xpath', $xpath);
  $widget_settings['toolbar'] ? $this
    ->assertToolbarExists() : $this
    ->assertToolbarNotExists();
  $this
    ->assertEditorOption('mode', $widget_settings['mode']);
  $this
    ->assertEditorOption('lineNumbers', $widget_settings['lineNumbers']);
  $this
    ->assertEditorOption('foldGutter', $widget_settings['foldGutter']);
  $this
    ->assertEditorOption('autoCloseTags', $widget_settings['autoCloseTags']);
  $this
    ->assertEditorOption('styleActiveLine', $widget_settings['styleActiveLine']);
}