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

Function TestNonWorkerModeAlwaysWorks

worker_test.go:56–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestNonWorkerModeAlwaysWorks(t *testing.T) {
57 runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
58 req := httptest.NewRequest("GET", "http://example.com/index.php", nil)
59 w := httptest.NewRecorder()
60 handler(w, req)
61
62 resp := w.Result()
63 body, _ := io.ReadAll(resp.Body)
64
65 assert.Contains(t, string(body), "I am by birth a Genevese")
66 }, &testOptions{workerScript: "phpinfo.php"})
67}
68
69func TestCannotCallHandleRequestInNonWorkerMode(t *testing.T) {
70 runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {

Callers

nothing calls this directly

Calls 2

runTestFunction · 0.85
ResultMethod · 0.80

Tested by

no test coverage detected