You are here

public function TextFormatElementFormTest::buildForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/filter/src/Tests/TextFormatElementFormTest.php \Drupal\filter\Tests\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/src/Tests/TextFormatElementFormTest.php, line 81
Contains \Drupal\filter\Tests\TextFormatElementFormTest.

Class

TextFormatElementFormTest
Tests PathElement validation and conversion functionality.

Namespace

Drupal\filter\Tests

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;
}