You are here

protected function WebTestBase::initUserSession in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::initUserSession()

Initializes user 1 for the site to be installed.

2 calls to WebTestBase::initUserSession()
UpdatePathTestBase::setUp in core/modules/system/src/Tests/Update/UpdatePathTestBase.php
Overrides WebTestBase::setUp() for update testing.
WebTestBase::setUp in core/modules/simpletest/src/WebTestBase.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/simpletest/src/WebTestBase.php, line 979
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function initUserSession() {

  // Define information about the user 1 account.
  $this->rootUser = new UserSession(array(
    'uid' => 1,
    'name' => 'admin',
    'mail' => 'admin@example.com',
    'pass_raw' => $this
      ->randomMachineName(),
  ));

  // The child site derives its session name from the database prefix when
  // running web tests.
  $this
    ->generateSessionName($this->databasePrefix);
}