You are here

class ForcePasswordChangeServiceTest in Force Password Change 2.0.x

Same name in this branch
  1. 2.0.x tests/src/Unit/Service/ForcePasswordChangeServiceTest.php \Drupal\Tests\force_password_change\Unit\Service\ForcePasswordChangeServiceTest
  2. 2.0.x tests/modules/force_password_change_service_test/src/Service/ForcePasswordChangeServiceTest.php \Drupal\force_password_change_service_test\Service\ForcePasswordChangeServiceTest

Test class created to override the ForcePasswordChangeService service.

Hierarchy

Expanded class hierarchy of ForcePasswordChangeServiceTest

1 file declares its use of ForcePasswordChangeServiceTest
ForcePasswordChangeServiceTest.php in tests/src/Unit/Service/ForcePasswordChangeServiceTest.php

File

tests/modules/force_password_change_service_test/src/Service/ForcePasswordChangeServiceTest.php, line 10

Namespace

Drupal\force_password_change_service_test\Service
View source
class ForcePasswordChangeServiceTest extends ForcePasswordChangeService {

  /**
   * {@inheritdoc}
   */
  protected function userLoadMultiple(array $uids) {
    $return = [];
    foreach ($uids as $uid) {
      $return[$uid] = 'user' . $uid;
    }
    return $return;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ForcePasswordChangeService::$configFactory protected property The config factory object.
ForcePasswordChangeService::$currentUser protected property The current user.
ForcePasswordChangeService::$mapper protected property The force password change data mapper.
ForcePasswordChangeService::$time protected property The time service.
ForcePasswordChangeService::$userData protected property The config factory object.
ForcePasswordChangeService::addFirstTimeLogin public function Mark a user as having been forced to change their password on their first login. Overrides ForcePasswordChangeServiceInterface::addFirstTimeLogin
ForcePasswordChangeService::checkForForce public function Check to see if the current user has a pending forced password change. Overrides ForcePasswordChangeServiceInterface::checkForForce
ForcePasswordChangeService::forceUserPasswordChange public function Force a password change for a given user. Overrides ForcePasswordChangeServiceInterface::forceUserPasswordChange
ForcePasswordChangeService::forceUsersPasswordChange public function Force a password change for the given users. Overrides ForcePasswordChangeServiceInterface::forceUsersPasswordChange
ForcePasswordChangeService::getFirstTimeLoginUids public function Retrieve a list of users who have a pending forced password change on their first login. Overrides ForcePasswordChangeServiceInterface::getFirstTimeLoginUids
ForcePasswordChangeService::getLastChangeForRole public function Get the last time at which a role was forced to change passwords for all users. Overrides ForcePasswordChangeServiceInterface::getLastChangeForRole
ForcePasswordChangeService::getNonPendingUsersForRole public function Retrieve the user accounts of users in the role who do not have a pending forced password change. Overrides ForcePasswordChangeServiceInterface::getNonPendingUsersForRole
ForcePasswordChangeService::getPendingUsersForRole public function Retrieve the users with a pending forced password change in a given role. Overrides ForcePasswordChangeServiceInterface::getPendingUsersForRole
ForcePasswordChangeService::getRequestTime protected function Retrieve the timestamp for the current request. Spun out into a protected function to allow for overriding in Unit Tests.
ForcePasswordChangeService::getRoleExpiryTimePeriods public function Get the time periods after which each role will expire. Overrides ForcePasswordChangeServiceInterface::getRoleExpiryTimePeriods
ForcePasswordChangeService::getTextDate public function Converts a number of seconds to a human-friendly time period. Overrides ForcePasswordChangeServiceInterface::getTextDate
ForcePasswordChangeService::getUserCountForRole public function Get the number of users in the given role. Overrides ForcePasswordChangeServiceInterface::getUserCountForRole
ForcePasswordChangeService::getUsersForRole public function Retrieve the users in a given role. Overrides ForcePasswordChangeServiceInterface::getUsersForRole
ForcePasswordChangeService::insertExpiryForRoles public function Insert the time period after which passwords should expire, for the given roles. Overrides ForcePasswordChangeServiceInterface::insertExpiryForRoles
ForcePasswordChangeService::registerForcePasswordTime public function Register the time at which a user has been forced to change their password. Overrides ForcePasswordChangeServiceInterface::registerForcePasswordTime
ForcePasswordChangeService::removeFirstTimeLogin public function Remove the mark for a user who was forced to change their password on their first login. Overrides ForcePasswordChangeServiceInterface::removeFirstTimeLogin
ForcePasswordChangeService::removePendingForce public function Remove a pending force for a given user. Overrides ForcePasswordChangeServiceInterface::removePendingForce
ForcePasswordChangeService::setChangedTimeForUser public function Set the last time a user's password was changed to the current timestamp. Overrides ForcePasswordChangeServiceInterface::setChangedTimeForUser
ForcePasswordChangeService::updateExpiryForRole public function Update the time period expiration data for a given role. Overrides ForcePasswordChangeServiceInterface::updateExpiryForRole
ForcePasswordChangeService::updateLastChangeForRoles public function Update the time at which all users in the given roles have been forced to change their passwords. Overrides ForcePasswordChangeServiceInterface::updateLastChangeForRoles
ForcePasswordChangeService::__construct public function Constructs a ForcePasswordChangeService object.
ForcePasswordChangeServiceTest::userLoadMultiple protected function Helper function to load mulitple user objects. Spun out into a protected function to allow for overriding in Unit Tests. Overrides ForcePasswordChangeService::userLoadMultiple