Skip to content

Commit

Permalink
add updateUserLastLogin to fake client
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbitronics committed Sep 20, 2024
1 parent c5243e3 commit 72fce7b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions features/fakes/FakeIdBrokerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ public function mfaVerify(int $id, string $employeeId, string|array $value): arr
];
}

/**
* Update the User last_login_utc by calling the internal method
* @param string $employeeId
* @return array An array of information about the updated user only including last_login_utc and employee_id
* @throws Exception
*/
public function updateUserLastLogin(string $employeeId): array
{
if (empty($employee_id)) {
throw new InvalidArgumentException('employee_id is required');
}

$nowUtc = gmdate('Y-m-d H:i:s');

return [
'employee_id' => $employeeId,
'last_login_utc' => $nowUtc,
];
}

/**
* Create a new MFA configuration
* @param string $employee_id
Expand Down

0 comments on commit 72fce7b

Please sign in to comment.