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()

Overrides FormInterface::buildForm

File

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

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.