function TextFormatElementFormTest::testTextFormatElement
Same name in other branches
- 9 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::testTextFormatElement()
- 8.9.x core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::testTextFormatElement()
- 10 core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php \Drupal\Tests\filter\Kernel\TextFormatElementFormTest::testTextFormatElement()
Tests that values are returned.
File
-
core/
modules/ filter/ tests/ src/ Kernel/ TextFormatElementFormTest.php, line 120
Class
- TextFormatElementFormTest
- Tests PathElement validation and conversion functionality.
Namespace
Drupal\Tests\filter\KernelCode
public function testTextFormatElement() : void {
/** @var \Drupal\Core\Form\FormBuilder $form_builder */
$form_builder = $this->container
->get('form_builder');
$form = $form_builder->getForm($this);
$output = $this->render($form);
$this->setRawContent($output);
$this->assertFieldByName('text_format[value]');
$this->assertRaw('<h4>Full HTML</h4>');
$this->assertRaw('<h4>Filtered HTML</h4>');
$this->assertRaw('<h4>Test format</h4>');
$this->assertNoPattern('|<h4[^>]*></h4>|', 'No empty H4 element found.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.