MCPcopy Create free account
hub / github.com/php/frankenphp / TestPHP

Function TestPHP

caddy/caddy_test.go:76–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestPHP(t *testing.T) {
77 var wg sync.WaitGroup
78 tester := caddytest.NewTester(t)
79 initServer(t, tester, `
80 {
81 skip_install_trust
82 admin localhost:2999
83 http_port `+testPort+`
84 https_port 9443
85 }
86
87 localhost:`+testPort+` {
88 route {
89 php {
90 root ../testdata
91 }
92 }
93 }
94 `, "caddyfile")
95
96 for i := range 100 {
97 wg.Add(1)
98
99 go func(i int) {
100 tester.AssertGetResponse(fmt.Sprintf("http://localhost:"+testPort+"/index.php?i=%d", i), http.StatusOK, fmt.Sprintf("I am by birth a Genevese (%d)", i))
101 wg.Done()
102 }(i)
103 }
104 wg.Wait()
105}
106
107func TestLargeRequest(t *testing.T) {
108 tester := caddytest.NewTester(t)

Callers

nothing calls this directly

Calls 1

initServerFunction · 0.85

Tested by

no test coverage detected