MCPcopy Index your code
hub / github.com/php/frankenphp / testRequestHeaders

Function testRequestHeaders

frankenphp_test.go:695–705  ·  view source on GitHub ↗
(t *testing.T, opts *testOptions)

Source from the content-addressed store, hash-verified

693 testRequestHeaders(t, &testOptions{workerScript: "request-headers.php"})
694}
695func 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
707func TestFailingWorker(t *testing.T) {
708 t.Cleanup(frankenphp.Shutdown)

Callers 2

Calls 2

runTestFunction · 0.85
testRequestFunction · 0.85

Tested by

no test coverage detected