(t *testing.T)
| 133 | } |
| 134 | |
| 135 | func 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 | |
| 170 | func TestGlobalAndModuleWorker(t *testing.T) { |
| 171 | var wg sync.WaitGroup |
nothing calls this directly
no test coverage detected