(t *testing.T, opts *testOptions)
| 693 | testRequestHeaders(t, &testOptions{workerScript: "request-headers.php"}) |
| 694 | } |
| 695 | func testRequestHeaders(t *testing.T, opts *testOptions) { |
| 696 | runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { |
| 697 | req := httptest.NewRequest("GET", fmt.Sprintf("http://example.com/request-headers.php?i=%d", i), nil) |
| 698 | req.Header.Add(strings.Clone("Content-Type"), strings.Clone("text/plain")) |
| 699 | req.Header.Add(strings.Clone("Frankenphp-I"), strings.Clone(strconv.Itoa(i))) |
| 700 | body, _ := testRequest(req, handler, t) |
| 701 | |
| 702 | assert.Contains(t, body, "[Content-Type] => text/plain") |
| 703 | assert.Contains(t, body, fmt.Sprintf("[Frankenphp-I] => %d", i)) |
| 704 | }, opts) |
| 705 | } |
| 706 | |
| 707 | func TestFailingWorker(t *testing.T) { |
| 708 | t.Cleanup(frankenphp.Shutdown) |
no test coverage detected