function FilterFormTest::setUp

Same name in other branches
  1. 8.9.x core/modules/filter/tests/src/Functional/FilterFormTest.php \Drupal\Tests\filter\Functional\FilterFormTest::setUp()
  2. 10 core/modules/filter/tests/src/Functional/FilterFormTest.php \Drupal\Tests\filter\Functional\FilterFormTest::setUp()
  3. 11.x core/modules/filter/tests/src/Functional/FilterFormTest.php \Drupal\Tests\filter\Functional\FilterFormTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/filter/tests/src/Functional/FilterFormTest.php, line 44

Class

FilterFormTest
Tests form elements with associated text formats.

Namespace

Drupal\Tests\filter\Functional

Code

protected function setUp() : void {
    parent::setUp();
    
    /** @var \Drupal\filter\FilterFormatInterface $filter_test_format */
    $filter_test_format = FilterFormat::load('filter_test');
    
    /** @var \Drupal\filter\FilterFormatInterface $filtered_html_format */
    $filtered_html_format = FilterFormat::load('filtered_html');
    
    /** @var \Drupal\filter\FilterFormatInterface $full_html_format */
    $full_html_format = FilterFormat::load('full_html');
    // Create users.
    $this->adminUser = $this->drupalCreateUser([
        'administer filters',
        $filtered_html_format->getPermissionName(),
        $full_html_format->getPermissionName(),
        $filter_test_format->getPermissionName(),
    ]);
    $this->webUser = $this->drupalCreateUser([
        $filtered_html_format->getPermissionName(),
        $filter_test_format->getPermissionName(),
    ]);
}

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