public function UserFormTest::testUserResetSpoof in Username Enumeration Prevention 8
Asserts messages on various anonymous forms dont include usernames.
File
- tests/
src/ Functional/ UserFormTest.php, line 25
Class
- UserFormTest
- Performs integration tests on forms.
Namespace
Drupal\Tests\username_enumeration_prevention\FunctionalCode
public function testUserResetSpoof() {
$account = $this
->createUser();
$this
->drupalGet(Url::fromRoute('user.reset.login', [
'uid' => $account
->id(),
'timestamp' => 1558364581,
'hash' => 'GMGVHMkyV0I-1XnefRMKrt5gBa2qVq4oOdjLtqCCBqM',
]));
$this
->assertSession()
->pageTextNotContains($account
->getAccountName());
}