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

Function TestWorker

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

Source from the content-addressed store, hash-verified

133}
134
135func TestWorker(t *testing.T) {
136 var wg sync.WaitGroup
137 tester := caddytest.NewTester(t)
138 initServer(t, tester, `
139 {
140 skip_install_trust
141 admin localhost:2999
142 http_port `+testPort+`
143 https_port 9443
144
145 frankenphp {
146 worker ../testdata/index.php 2
147 }
148 }
149
150 localhost:`+testPort+` {
151 route {
152 php {
153 root ../testdata
154 }
155 }
156 }
157 `, "caddyfile")
158
159 for i := range 100 {
160 wg.Add(1)
161
162 go func(i int) {
163 tester.AssertGetResponse(fmt.Sprintf("http://localhost:"+testPort+"/index.php?i=%d", i), http.StatusOK, fmt.Sprintf("I am by birth a Genevese (%d)", i))
164 wg.Done()
165 }(i)
166 }
167 wg.Wait()
168}
169
170func TestGlobalAndModuleWorker(t *testing.T) {
171 var wg sync.WaitGroup

Callers

nothing calls this directly

Calls 1

initServerFunction · 0.85

Tested by

no test coverage detected