function RestLoginHttpTest::testPasswordReset
Same name and namespace in other branches
- main core/modules/rest/tests/src/Functional/RestLoginHttpTest.php \Drupal\Tests\rest\Functional\RestLoginHttpTest::testPasswordReset()
Tests user password reset.
File
-
core/
modules/ rest/ tests/ src/ Functional/ RestLoginHttpTest.php, line 243
Class
- RestLoginHttpTest
- Tests login and password reset via direct HTTP.
Namespace
Drupal\Tests\rest\FunctionalCode
public function testPasswordReset() : void {
// 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->rebuildAll();
$this->doTestPasswordReset('json', $account);
$this->doTestPasswordReset('xml', $account);
$this->doTestGlobalLoginFloodControl('json');
$this->doTestPerUserLoginFloodControl('json');
$this->doTestLogoutCsrfProtection('json');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.