public function TextFormatElementFormTest::buildForm in Drupal 9
Same name and namespace in other branches
- 8 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::buildForm()
- 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 90
Class
- TextFormatElementFormTest
- Tests PathElement validation and conversion functionality.
Namespace
Drupal\Tests\filter\KernelCode
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;
}