Issue #3308920 by jungle, smustgrave, Lendude: Fix test performance of Drupal\Tests\user\FunctionalJavascript\UserPasswordResetTest
(cherry picked from commit 1ac46a2af3
)
merge-requests/3575/head
parent
7cff4a621e
commit
2fdab0bde3
|
@ -24,17 +24,6 @@ class UserPasswordResetTest extends WebDriverTestBase {
|
|||
getTestFiles as drupalGetTestFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* The profile to install as a basis for testing.
|
||||
*
|
||||
* This test uses the standard profile to test the password reset in
|
||||
* combination with an ajax request provided by the user picture configuration
|
||||
* in the standard profile.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $profile = 'standard';
|
||||
|
||||
/**
|
||||
* The user object to test password resetting.
|
||||
*
|
||||
|
@ -45,7 +34,12 @@ class UserPasswordResetTest extends WebDriverTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected static $modules = ['block'];
|
||||
protected static $modules = ['block', 'test_user_config'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'stark';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -54,7 +48,7 @@ class UserPasswordResetTest extends WebDriverTestBase {
|
|||
parent::setUp();
|
||||
|
||||
// Create a user.
|
||||
$account = $this->drupalCreateUser();
|
||||
$account = $this->drupalCreateUser(['access content']);
|
||||
|
||||
// Activate user by logging in.
|
||||
$this->drupalLogin($account);
|
||||
|
@ -65,7 +59,7 @@ class UserPasswordResetTest extends WebDriverTestBase {
|
|||
|
||||
// Set the last login time that is used to generate the one-time link so
|
||||
// that it is definitely over a second ago.
|
||||
$account->login = REQUEST_TIME - mt_rand(10, 100000);
|
||||
$account->login = \Drupal::time()->getRequestTime() - mt_rand(10, 100000);
|
||||
Database::getConnection()->update('users_field_data')
|
||||
->fields(['login' => $account->getLastLoginTime()])
|
||||
->condition('uid', $account->id())
|
||||
|
|
|
@ -2490,11 +2490,6 @@ parameters:
|
|||
count: 1
|
||||
path: modules/user/tests/src/Functional/Views/UserChangedTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
|
||||
count: 1
|
||||
path: modules/user/tests/src/FunctionalJavascript/UserPasswordResetTest.php
|
||||
|
||||
-
|
||||
message: "#^Variable \\$result in isset\\(\\) always exists and is not nullable\\.$#"
|
||||
count: 1
|
||||
|
|
Loading…
Reference in New Issue