public function UserLoginHttpTest::testPasswordReset in Drupal 9
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Functional/UserLoginHttpTest.php \Drupal\Tests\user\Functional\UserLoginHttpTest::testPasswordReset()
Tests user password reset.
File
- core/
modules/ user/ tests/ src/ Functional/ UserLoginHttpTest.php, line 239
Class
- UserLoginHttpTest
- Tests login and password reset via direct HTTP.
Namespace
Drupal\Tests\user\FunctionalCode
public function testPasswordReset() {
// Create a user account.
$account = $this
->drupalCreateUser();
// Without the serialization module only JSON is supported.
$this
->doTestPasswordReset('json', $account);
// Enable serialization so we have access to additional formats.
$this->container
->get('module_installer')
->install([
'serialization',
]);
$this
->doTestPasswordReset('json', $account);
$this
->doTestPasswordReset('xml', $account);
$this
->doTestPasswordReset('hal_json', $account);
}