MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / TestAuthOriginCollectionRef

Function TestAuthOriginCollectionRef

core/auth_origin_model_test.go:64–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestAuthOriginCollectionRef(t *testing.T) {
65 t.Parallel()
66
67 app, _ := tests.NewTestApp()
68 defer app.Cleanup()
69
70 origin := core.NewAuthOrigin(app)
71
72 testValues := []string{"test_1", "test2", ""}
73 for i, testValue := range testValues {
74 t.Run(fmt.Sprintf("%d_%q", i, testValue), func(t *testing.T) {
75 origin.SetCollectionRef(testValue)
76
77 if v := origin.CollectionRef(); v != testValue {
78 t.Fatalf("Expected getter %q, got %q", testValue, v)
79 }
80
81 if v := origin.GetString("collectionRef"); v != testValue {
82 t.Fatalf("Expected field value %q, got %q", testValue, v)
83 }
84 })
85 }
86}
87
88func TestAuthOriginFingerprint(t *testing.T) {
89 t.Parallel()

Callers

nothing calls this directly

Calls 7

CleanupMethod · 0.95
SetCollectionRefMethod · 0.95
CollectionRefMethod · 0.95
NewTestAppFunction · 0.92
NewAuthOriginFunction · 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…