function ContactPersonalTest::setUp

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

Overrides BrowserTestBase::setUp

File

core/modules/contact/tests/src/Functional/ContactPersonalTest.php, line 59

Class

ContactPersonalTest
Tests personal contact form functionality.

Namespace

Drupal\Tests\contact\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Create an admin user.
    $this->adminUser = $this->drupalCreateUser([
        'administer contact forms',
        'administer users',
        'administer account settings',
        'access site reports',
    ]);
    // Create some normal users with their contact forms enabled by default.
    $this->config('contact.settings')
        ->set('user_default_enabled', TRUE)
        ->save();
    $this->webUser = $this->drupalCreateUser([
        'access user profiles',
        'access user contact forms',
    ]);
    $this->contactUser = $this->drupalCreateUser();
}

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