UserFormTest.php in Username Enumeration Prevention 8
File
tests/src/Functional/UserFormTest.php
View source
<?php
namespace Drupal\Tests\username_enumeration_prevention\Functional;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
class UserFormTest extends BrowserTestBase {
public static $modules = [
'username_enumeration_prevention',
];
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());
}
}