Chore: Move methods from sqlstore to user store (#56305)
* Copy sqlstore methods to suer store * Adjust ProvideService signatures in test * Add xorm tags and tests for search * Remove methods from sqlstore * fix lint in tests
This commit is contained in:
@@ -129,11 +129,12 @@ func TestUserService(t *testing.T) {
|
||||
}
|
||||
|
||||
type FakeUserStore struct {
|
||||
ExpectedUser *user.User
|
||||
ExpectedSignedInUser *user.SignedInUser
|
||||
ExpectedUserProfile *user.UserProfileDTO
|
||||
ExpectedError error
|
||||
ExpectedDeleteUserError error
|
||||
ExpectedUser *user.User
|
||||
ExpectedSignedInUser *user.SignedInUser
|
||||
ExpectedUserProfile *user.UserProfileDTO
|
||||
ExpectedSearchUserQueryResult *user.SearchUserQueryResult
|
||||
ExpectedError error
|
||||
ExpectedDeleteUserError error
|
||||
}
|
||||
|
||||
func newUserStoreFake() *FakeUserStore {
|
||||
@@ -203,3 +204,15 @@ func (f *FakeUserStore) SetHelpFlag(ctx context.Context, cmd *user.SetUserHelpFl
|
||||
func (f *FakeUserStore) UpdatePermissions(ctx context.Context, userID int64, isAdmin bool) error {
|
||||
return f.ExpectedError
|
||||
}
|
||||
|
||||
func (f *FakeUserStore) BatchDisableUsers(ctx context.Context, cmd *user.BatchDisableUsersCommand) error {
|
||||
return f.ExpectedError
|
||||
}
|
||||
|
||||
func (f *FakeUserStore) Disable(ctx context.Context, cmd *user.DisableUserCommand) error {
|
||||
return f.ExpectedError
|
||||
}
|
||||
|
||||
func (f *FakeUserStore) Search(ctx context.Context, query *user.SearchUsersQuery) (*user.SearchUserQueryResult, error) {
|
||||
return f.ExpectedSearchUserQueryResult, f.ExpectedError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user