| 54 | } |
| 55 | |
| 56 | func 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 | |
| 69 | func TestCannotCallHandleRequestInNonWorkerMode(t *testing.T) { |
| 70 | runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { |