mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-14 21:59:05 +02:00
feat: add ability to force email verification (#1837)
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
// This file contains utils for unit tests and it's only built when the "unit" tag is set
|
||||
package appconfig
|
||||
|
||||
import "context"
|
||||
|
||||
// NewTestAppConfigService is a function used by tests to create AppConfigService objects with pre-defined configuration values
|
||||
func NewTestAppConfigService(config *AppConfigModel) *AppConfigService {
|
||||
if config == nil {
|
||||
@@ -25,3 +27,12 @@ func NewTestConfig(config *AppConfigModel) *AppConfigModel {
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
// StaticResolver is an AppConfigResolver for tests that always returns the same configuration, or the default one when none is set
|
||||
type StaticResolver struct {
|
||||
Config *AppConfigModel
|
||||
}
|
||||
|
||||
func (r StaticResolver) GetConfig(context.Context) (*AppConfigModel, error) {
|
||||
return NewTestConfig(r.Config), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user