You are here

public function TextFormatElementFormTest::buildForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::buildForm()
  2. 9 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::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 textformat field.
  $form['textformat'] = [
    '#type' => 'text_format',
    '#required' => TRUE,
    '#title' => 'Text',
    '#base_type' => 'textfield',
    '#format' => NULL,
    '#default_value' => 'test value',
  ];
  return $form;
}