function FilterSecurityTest::setUp

Overrides BrowserTestBase::setUp

File

core/modules/filter/tests/src/Functional/FilterSecurityTest.php, line 38

Class

FilterSecurityTest
Tests the behavior of check_markup() when a filter or text format vanishes, or when check_markup() is called in such a way that it is instructed to skip all filters of the "FilterInterface::TYPE_HTML_RESTRICTOR" type.

Namespace

Drupal\Tests\filter\Functional

Code

protected function setUp() {
  parent::setUp();
  // Create Basic page node type.
  $this->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
  ]);
  /** @var \Drupal\filter\Entity\FilterFormat $filtered_html_format */
  $filtered_html_format = FilterFormat::load('filtered_html');
  $filtered_html_permission = $filtered_html_format->getPermissionName();
  user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [
    $filtered_html_permission,
  ]);
  $this->adminUser = $this->drupalCreateUser([
    'administer modules',
    'administer filters',
    'administer site configuration',
  ]);
  $this->drupalLogin($this->adminUser);
}

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