function TextFormatElementFormTest::buildForm

Same name and namespace in other branches
  1. 9 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::buildForm()
  2. 8.9.x core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::buildForm()
  3. 10 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php, line 88

Class

TextFormatElementFormTest
Tests PathElement validation and conversion functionality.

Namespace

Drupal\Tests\filter\Kernel

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  // A text_format field.
  $form['text_format'] = [
    '#type' => 'text_format',
    '#required' => TRUE,
    '#title' => 'Text',
    '#base_type' => 'textfield',
    '#format' => NULL,
    '#default_value' => 'test value',
  ];
  return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.