You are here

public function SimplenewsPersonalizationFormsTest::testSubscribeRequestPassword in Simplenews 8

Subscribe, request password: "name is not recognized".

File

src/Tests/SimplenewsPersonalizationFormsTest.php, line 93

Class

SimplenewsPersonalizationFormsTest
Tests crucial aspects of Subscriber fieldability and User field sync.

Namespace

Drupal\simplenews\Tests

Code

public function testSubscribeRequestPassword() {
  $email = $this
    ->randomEmail();

  // Subscribe.
  $this
    ->subscribe('default', $email);

  // Request new password.
  $this
    ->drupalPostForm('user/password', array(
    'name' => $email,
  ), t('Submit'));

  // Assert the email is not recognized as an account.
  $this
    ->assertRaw(t('%name is not recognized as a username or an email address.', array(
    '%name' => $email,
  )));
}