protected static $modules =
['user'
];
/**
* {@inheritdoc}
*/
protected function setUp(): void
{ parent::
setUp();
// Make sure the admin user and a regular user are created.
$this->container->
get('module_handler'
)->
loadInclude('user', 'install'
);
$this->
installEntitySchema('user'
);
user_install();
/** @var \Drupal\user\Entity\User $admin_account */
$admin_account = User::
load(1
);
$admin_account->
setPassword('original'
);
$admin_account->
save();
$this->originalPasswords
[1
] =
$admin_account->
getPassword();
/** @var \Drupal\user\Entity\User $user_account */
$user_account = User::
create([ 'uid' => 2,
'name' => 'original_username',
'mail' => 'original_email@example.com',