function UserAuthenticationTest::testAuthenticateWithIncorrectPassword
Tests the authenticate method with an incorrect password.
File
-
core/
modules/ user/ tests/ src/ Unit/ UserAuthenticationTest.php, line 113
Class
Namespace
Drupal\Tests\user\UnitCode
public function testAuthenticateWithIncorrectPassword() : void {
$this->userStorage
->expects($this->once())
->method('loadByProperties')
->with([
'name' => $this->username,
])
->willReturn([
$this->createStub(User::class),
]);
$this->passwordService
->method('check')
->willReturn(FALSE);
$user = $this->userAuth
->lookupAccount($this->username);
$this->assertFalse($this->userAuth
->authenticateAccount($user, $this->password));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.