function UserAuthenticationTest::setUpMockPasswordService

Reinitializes the password service as a mock object.

1 call to UserAuthenticationTest::setUpMockPasswordService()
UserAuthenticationTest::testAuthenticateWithZeroPassword in core/modules/user/tests/src/Unit/UserAuthenticationTest.php
Tests the authenticate method with a correct password.

File

core/modules/user/tests/src/Unit/UserAuthenticationTest.php, line 90

Class

UserAuthenticationTest
Tests Drupal\user\UserAuthentication.

Namespace

Drupal\Tests\user\Unit

Code

protected function setUpMockPasswordService() : void {
  $this->passwordService = $this->createMock(PasswordInterface::class);
  $reflection = new \ReflectionProperty($this->userAuth, 'passwordChecker');
  $reflection->setValue($this->userAuth, $this->passwordService);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.