1 #include "user_mgr.hpp" 2 3 #include <gmock/gmock.h> 4 5 namespace phosphor 6 { 7 namespace user 8 { 9 10 constexpr auto objpath = "/dummy/user"; 11 12 class MockManager : public UserMgr 13 { 14 public: 15 MockManager(sdbusplus::bus_t& bus, const char* path) : UserMgr(bus, path) {} 16 17 MOCK_METHOD0(getPrivilegeMapperObject, DbusUserObj()); 18 MOCK_METHOD1(userLockedForFailedAttempt, bool(const std::string& userName)); 19 MOCK_METHOD1(userPasswordExpired, bool(const std::string& userName)); 20 MOCK_CONST_METHOD1(getPrimaryGroup, gid_t(const std::string& userName)); 21 MOCK_CONST_METHOD3(isGroupMember, 22 bool(const std::string& userName, gid_t primaryGid, 23 const std::string& groupName)); 24 25 friend class TestUserMgr; 26 }; 27 28 } // namespace user 29 } // namespace phosphor 30