You are here

protected function FormTest::setUp in Drupal 9

Same name in this branch
  1. 9 core/modules/field/tests/src/Functional/FormTest.php \Drupal\Tests\field\Functional\FormTest::setUp()
  2. 9 core/modules/system/tests/src/Functional/Form/FormTest.php \Drupal\Tests\system\Functional\Form\FormTest::setUp()
Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Form/FormTest.php \Drupal\Tests\system\Functional\Form\FormTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/Form/FormTest.php, line 36

Class

FormTest
Tests various form element validation mechanisms.

Namespace

Drupal\Tests\system\Functional\Form

Code

protected function setUp() : void {
  parent::setUp();
  $filtered_html_format = FilterFormat::create([
    'format' => 'filtered_html',
    'name' => 'Filtered HTML',
  ]);
  $filtered_html_format
    ->save();
  $filtered_html_permission = $filtered_html_format
    ->getPermissionName();
  user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [
    $filtered_html_permission,
  ]);
}