Test_Bind_Form_Map_SkipsStructValidator() — fiber Function Reference
Architecture documentation for the Test_Bind_Form_Map_SkipsStructValidator() function in bind_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD 664e5e28_41da_2541_3dee_107fa616add8["Test_Bind_Form_Map_SkipsStructValidator()"] 55065b01_f5dc_4e53_5a74_5ecc7aca8f52["bind_test.go"] 664e5e28_41da_2541_3dee_107fa616add8 -->|defined in| 55065b01_f5dc_4e53_5a74_5ecc7aca8f52 style 664e5e28_41da_2541_3dee_107fa616add8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
bind_test.go lines 1887–1928
func Test_Bind_Form_Map_SkipsStructValidator(t *testing.T) {
t.Parallel()
makeRequest := func(c Ctx) {
body := []byte("name=john")
c.Request().SetBody(body)
c.Request().Header.SetContentType(MIMEApplicationForm)
c.Request().Header.SetContentLength(len(body))
}
t.Run("without validator", func(t *testing.T) {
t.Parallel()
app := New()
c := app.AcquireCtx(&fasthttp.RequestCtx{})
t.Cleanup(func() {
app.ReleaseCtx(c)
})
makeRequest(c)
req := make(map[string]string)
require.NoError(t, c.Bind().Form(&req))
require.Equal(t, "john", req["name"])
})
t.Run("with struct validator configured", func(t *testing.T) {
t.Parallel()
validator := &countingStructValidator{}
app := New(Config{StructValidator: validator})
c := app.AcquireCtx(&fasthttp.RequestCtx{})
t.Cleanup(func() {
app.ReleaseCtx(c)
})
makeRequest(c)
req := make(map[string]string)
require.NoError(t, c.Bind().Form(&req))
require.Equal(t, "john", req["name"])
require.Equal(t, 0, validator.calls)
})
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_Bind_Form_Map_SkipsStructValidator() do?
Test_Bind_Form_Map_SkipsStructValidator() is a function in the fiber codebase, defined in bind_test.go.
Where is Test_Bind_Form_Map_SkipsStructValidator() defined?
Test_Bind_Form_Map_SkipsStructValidator() is defined in bind_test.go at line 1887.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free