Documentation
¶
Index ¶
- func Equal(t *testing.T, expected, actual interface{})
- func HTTPBodyContainsf(t *testing.T, handler http.HandlerFunc, method, urlStr string, ...)
- func HTTPBodyNotContainsf(t *testing.T, handler http.HandlerFunc, method, urlStr string, ...)
- func MakePostRequest(t *testing.T, path string, values url.Values) (*httptest.ResponseRecorder, *http.Request)
- func NewAuthKnightConfigForTest() types.ConfigAuthKnight
- func NewAuthSharedForTest() types.AuthSharedInterface
- func NewPasswordlessConfigForTest() types.ConfigPasswordless
- func NewUsernameAndPasswordConfigForTest() types.ConfigUsernameAndPassword
- func Nil(t *testing.T, value interface{})
- func NotNil(t *testing.T, value interface{})
- func SetAuthKnightForTest(a types.AuthSharedInterface, authKnight bool)
- func SetFuncUserFindByAuthTokenForTest(a types.AuthSharedInterface, ...)
- func SetLoginURLForTest(a types.AuthSharedInterface, url string)
- func SetPasswordlessForTest(a types.AuthSharedInterface, passwordless bool)
- func SetRegistrationForTest(a types.AuthSharedInterface, registration bool)
- func SetTemporaryKeyGetForTest(a types.AuthSharedInterface, fn func(key string) (string, error))
- func SetUseCookiesForTest(a types.AuthSharedInterface, useCookies bool)
- func SetVerificationForTest(a types.AuthSharedInterface, verification bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPBodyContainsf ¶
func HTTPBodyContainsf(t *testing.T, handler http.HandlerFunc, method, urlStr string, values url.Values, expected string, msgAndArgs ...interface{})
HTTPBodyContainsf sends a request through handler and checks that the response body contains the expected substring.
func HTTPBodyNotContainsf ¶
func HTTPBodyNotContainsf(t *testing.T, handler http.HandlerFunc, method, urlStr string, values url.Values, expected string, msgAndArgs ...interface{})
HTTPBodyNotContainsf sends a request through handler and checks that the response body does not contain the expected substring.
func MakePostRequest ¶
func MakePostRequest(t *testing.T, path string, values url.Values) (*httptest.ResponseRecorder, *http.Request)
MakePostRequest is a small helper for tests that need to construct a POST request with form values and an httptest.ResponseRecorder.
func NewAuthKnightConfigForTest ¶ added in v0.35.0
func NewAuthKnightConfigForTest() types.ConfigAuthKnight
NewAuthKnightConfigForTest returns a ConfigAuthKnight pre-populated with safe defaults for tests.
func NewAuthSharedForTest ¶
func NewAuthSharedForTest() types.AuthSharedInterface
func NewPasswordlessConfigForTest ¶
func NewPasswordlessConfigForTest() types.ConfigPasswordless
NewPasswordlessConfigForTest returns a ConfigPasswordless pre-populated with safe defaults for tests.
func NewUsernameAndPasswordConfigForTest ¶
func NewUsernameAndPasswordConfigForTest() types.ConfigUsernameAndPassword
NewUsernameAndPasswordConfigForTest returns a ConfigUsernameAndPassword pre-populated with safe defaults for tests.
func SetAuthKnightForTest ¶ added in v0.35.0
func SetAuthKnightForTest(a types.AuthSharedInterface, authKnight bool)
SetAuthKnightForTest allows tests to configure the AuthKnight flag.
func SetFuncUserFindByAuthTokenForTest ¶
func SetFuncUserFindByAuthTokenForTest(a types.AuthSharedInterface, fn func(ctx context.Context, token string, options types.UserAuthOptions) (string, error))
SetFuncUserFindByAuthTokenForTest allows tests to control auth-token lookup behaviour.
func SetLoginURLForTest ¶
func SetLoginURLForTest(a types.AuthSharedInterface, url string)
SetLoginURLForTest allows tests to configure the login URL used by LinkLogin.
func SetPasswordlessForTest ¶
func SetPasswordlessForTest(a types.AuthSharedInterface, passwordless bool)
func SetRegistrationForTest ¶
func SetRegistrationForTest(a types.AuthSharedInterface, registration bool)
Test helpers to configure additional flags on the shared auth test double.
func SetTemporaryKeyGetForTest ¶ added in v0.35.0
func SetTemporaryKeyGetForTest(a types.AuthSharedInterface, fn func(key string) (string, error))
SetTemporaryKeyGetForTest allows tests to configure the TemporaryKeyGet function.
func SetUseCookiesForTest ¶
func SetUseCookiesForTest(a types.AuthSharedInterface, useCookies bool)
SetUseCookiesForTest allows tests to configure whether cookies are used.
func SetVerificationForTest ¶
func SetVerificationForTest(a types.AuthSharedInterface, verification bool)
Types ¶
This section is empty.