MCPcopy
hub / github.com/pocketbase/pocketbase / TestExternalAuthProvider

Function TestExternalAuthProvider

core/external_auth_model_test.go:87–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestExternalAuthProvider(t *testing.T) {
88 t.Parallel()
89
90 app, _ := tests.NewTestApp()
91 defer app.Cleanup()
92
93 ea := core.NewExternalAuth(app)
94
95 testValues := []string{"test_1", "test2", ""}
96 for i, testValue := range testValues {
97 t.Run(fmt.Sprintf("%d_%q", i, testValue), func(t *testing.T) {
98 ea.SetProvider(testValue)
99
100 if v := ea.Provider(); v != testValue {
101 t.Fatalf("Expected getter %q, got %q", testValue, v)
102 }
103
104 if v := ea.GetString("provider"); v != testValue {
105 t.Fatalf("Expected field value %q, got %q", testValue, v)
106 }
107 })
108 }
109}
110
111func TestExternalAuthProviderId(t *testing.T) {
112 t.Parallel()

Callers

nothing calls this directly

Calls 7

CleanupMethod · 0.95
SetProviderMethod · 0.95
ProviderMethod · 0.95
NewTestAppFunction · 0.92
NewExternalAuthFunction · 0.92
GetStringMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…