function FilterSecurityKernelTest::setUp

Same name and namespace in other branches
  1. 11.x core/modules/filter/tests/src/Kernel/FilterSecurityKernelTest.php \Drupal\Tests\filter\Kernel\FilterSecurityKernelTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/filter/tests/src/Kernel/FilterSecurityKernelTest.php, line 31

Class

FilterSecurityKernelTest
Tests that security filters are enforced even when marked to be skipped.

Namespace

Drupal\Tests\filter\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  // Create a dedicated text format for this test.
  FilterFormat::create([
    'format' => 'kernel_filtered_html',
    'name' => 'Kernel Filtered HTML',
    'filters' => [
      'filter_html' => [
        'status' => TRUE,
        'settings' => [
          'allowed_html' => '<p>',
        ],
      ],
    ],
  ])->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.