You are here

public function EmailRegistrationLoginTest::testFailedLogin in Email Registration 8

Tests trying to login with wrong password.

File

tests/src/Functional/Plugin/Commerce/CheckoutPane/EmailRegistrationLoginTest.php, line 149

Class

EmailRegistrationLoginTest
Tests the login checkout pane.

Namespace

Drupal\Tests\email_registration\Functional\Plugin\Commerce\CheckoutPane

Code

public function testFailedLogin() {

  // Create an user to login with.
  $account = $this
    ->drupalCreateUser();
  $this
    ->goToCheckout();
  $this
    ->assertCheckoutProgressStep('Login');
  $edit = [
    'email_registration_login[returning_customer][name]' => $account
      ->getEmail(),
    'email_registration_login[returning_customer][password]' => $account->passRaw . 'foo',
  ];
  $this
    ->submitForm($edit, 'Log in');
  $this
    ->assertSession()
    ->pageTextContains('Unrecognized email address or password. Forgot your password?');
}