private function FieldUiTest::createTextFormats in Field Formatter Filter 2.0.x
Same name and namespace in other branches
- 8 tests/src/Functional/FieldUiTest.php \Drupal\Tests\field_formatter_filter\Kernel\FieldUiTest::createTextFormats()
We need to set up two text formats.
1 call to FieldUiTest::createTextFormats()
- FieldUiTest::setUp in tests/
src/ Functional/ FieldUiTest.php
File
- tests/
src/ Functional/ FieldUiTest.php, line 170
Class
- FieldUiTest
- Tests applying the filter formatter to a node.
Namespace
Drupal\Tests\field_formatter_filter\KernelCode
private function createTextFormats() {
// Add a text format with no restrictions.
$format = FilterFormat::create([
'format' => 'full_html',
'name' => 'Full HTML',
]);
$format
->save();
// Add another text format with very limited markup.
$format = FilterFormat::create([
'format' => 'teaser_safe_text',
'name' => 'Teaser safe text',
]);
$format
->setFilterConfig('filter_html', [
'status' => 1,
'settings' => [
'allowed_html' => '<p> <br> <a href hreflang> <em> <strong>',
],
]);
$format
->save();
}