(t *testing.T, opts *testOptions)
| 313 | testPostSuperGlobals(t, &testOptions{workerScript: "super-globals.php"}) |
| 314 | } |
| 315 | func testPostSuperGlobals(t *testing.T, opts *testOptions) { |
| 316 | runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { |
| 317 | formData := url.Values{"baz": {"bat"}, "i": {fmt.Sprintf("%d", i)}} |
| 318 | req := httptest.NewRequest("POST", fmt.Sprintf("http://example.com/super-globals.php?foo=bar&iG=%d", i), strings.NewReader(formData.Encode())) |
| 319 | req.Header.Set("Content-Type", strings.Clone("application/x-www-form-urlencoded")) |
| 320 | body, _ := testRequest(req, handler, t) |
| 321 | |
| 322 | assert.Contains(t, body, "'foo' => 'bar'") |
| 323 | assert.Contains(t, body, fmt.Sprintf("'i' => '%d'", i)) |
| 324 | assert.Contains(t, body, "'baz' => 'bat'") |
| 325 | assert.Contains(t, body, fmt.Sprintf("'iG' => '%d'", i)) |
| 326 | }, opts) |
| 327 | } |
| 328 | |
| 329 | func TestRequestSuperGlobal_module(t *testing.T) { testRequestSuperGlobal(t, nil) } |
| 330 | func TestRequestSuperGlobal_worker(t *testing.T) { |
no test coverage detected