diff --git a/tests/src/Functional/EmailRegistrationTestCase.php b/tests/src/Functional/EmailRegistrationTestCase.php index 161fa96..e9f0800 100644 --- a/tests/src/Functional/EmailRegistrationTestCase.php +++ b/tests/src/Functional/EmailRegistrationTestCase.php @@ -68,8 +68,9 @@ class EmailRegistrationTestCase extends BrowserTestBase { 'pass' => $pass, ]; $this->drupalPostForm('user/login', $login, 'Log in'); - $error_message = $this->xpath('//div[contains(@class, "error")]'); - $this->assertNotEmpty($error_message, 'When login_with_username is false, a user cannot login with just their username.'); + // When login_with_username is false, a user cannot login with just their + // username. + $this->assertSession()->responseContains('Unrecognized email address or password.'); // Set login_with_username to TRUE and try to login with just username. $email_registration_config->set('login_with_username', TRUE)->save();