You are here

protected function SimplenewsTestBase::resetPassLogin in Simplenews 8

Login a user, resetting their password.

Can be used if user is unverified and does not yet have a password.

Parameters

\Drupal\user\UserInterface $user: The user to login.

2 calls to SimplenewsTestBase::resetPassLogin()
SimplenewsPersonalizationFormsTest::testDisableAccount in src/Tests/SimplenewsPersonalizationFormsTest.php
Disable account, subscriptions inactive.
SimplenewsPersonalizationFormsTest::testSynchronizeRegisterSubscribe in src/Tests/SimplenewsPersonalizationFormsTest.php
Register then subscribe: require login, fields updated.

File

src/Tests/SimplenewsTestBase.php, line 233
Simplenews test functions.

Class

SimplenewsTestBase
Base class for simplenews web tests.

Namespace

Drupal\simplenews\Tests

Code

protected function resetPassLogin(UserInterface $user) {
  $uid = $user
    ->id();
  $timestamp = REQUEST_TIME;
  $hash = user_pass_rehash($user, $timestamp);
  $this
    ->drupalPostForm("/user/reset/{$uid}/{$timestamp}/{$hash}", array(), t('Log in'));
}