function FunctionalTestSetupTrait::initUserSession
Initializes user 1 for the site to be installed.
File
-
core/
lib/ Drupal/ Core/ Test/ FunctionalTestSetupTrait.php, line 390
Class
- FunctionalTestSetupTrait
- Defines a trait for shared functional test setup functionality.
Namespace
Drupal\Core\TestCode
protected function initUserSession() {
$password = $this->randomMachineName();
// Define information about the user 1 account.
$this->rootUser = new UserSession([
'uid' => 1,
'name' => 'admin',
'mail' => 'admin@example.com',
'pass_raw' => $password,
'passRaw' => $password,
'timezone' => date_default_timezone_get(),
]);
// The child site derives its session name from the database prefix when
// running web tests.
$this->generateSessionName($this->databasePrefix);
}