You are here

protected function ContactPersonalTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/contact/src/Tests/ContactPersonalTest.php \Drupal\contact\Tests\ContactPersonalTest::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides WebTestBase::setUp

File

core/modules/contact/src/Tests/ContactPersonalTest.php, line 51
Contains \Drupal\contact\Tests\ContactPersonalTest.

Class

ContactPersonalTest
Tests personal contact form functionality.

Namespace

Drupal\contact\Tests

Code

protected function setUp() {
  parent::setUp();

  // Create an admin user.
  $this->adminUser = $this
    ->drupalCreateUser(array(
    '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(array(
    'access user profiles',
    'access user contact forms',
  ));
  $this->contactUser = $this
    ->drupalCreateUser();
}