blob: 99f2b37872f323b19649ac13bf7a341cab9982d8 [file] [log] [blame]
raviteja-b8cc44052019-02-27 23:29:36 -06001#include "user_mgr.hpp"
Patrick Williams9638afb2021-02-22 17:16:24 -06002
raviteja-b8cc44052019-02-27 23:29:36 -06003#include <gmock/gmock.h>
4
5namespace phosphor
6{
7namespace user
8{
9
10constexpr auto objpath = "/dummy/user";
11
12class MockManager : public UserMgr
13{
14 public:
Patrick Williamsb7043042023-05-10 07:50:52 -050015 MockManager(sdbusplus::bus_t& bus, const char* path) : UserMgr(bus, path) {}
raviteja-b8cc44052019-02-27 23:29:36 -060016
raviteja-b8cc44052019-02-27 23:29:36 -060017 MOCK_METHOD0(getPrivilegeMapperObject, DbusUserObj());
18 MOCK_METHOD1(userLockedForFailedAttempt, bool(const std::string& userName));
Joseph Reynolds3ab6cc22020-03-03 14:09:03 -060019 MOCK_METHOD1(userPasswordExpired, bool(const std::string& userName));
Denis Zlobine8edab52023-09-06 12:26:45 +000020 MOCK_METHOD1(isUserEnabled, bool(const std::string& userName));
Alexander Filippov75626582022-02-09 18:42:37 +030021 MOCK_CONST_METHOD1(getPrimaryGroup, gid_t(const std::string& userName));
22 MOCK_CONST_METHOD3(isGroupMember,
23 bool(const std::string& userName, gid_t primaryGid,
24 const std::string& groupName));
raviteja-b8cc44052019-02-27 23:29:36 -060025
26 friend class TestUserMgr;
27};
28
29} // namespace user
30} // namespace phosphor