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

Function TestCannotCallHandleRequestInNonWorkerMode

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

Source from the content-addressed store, hash-verified

67}
68
69func TestCannotCallHandleRequestInNonWorkerMode(t *testing.T) {
70 runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
71 req := httptest.NewRequest("GET", "http://example.com/non-worker.php", nil)
72 w := httptest.NewRecorder()
73 handler(w, req)
74
75 resp := w.Result()
76 body, _ := io.ReadAll(resp.Body)
77
78 assert.Contains(t, string(body), "<b>Fatal error</b>: Uncaught RuntimeException: frankenphp_handle_request() called while not in worker mode")
79 }, nil)
80}
81
82func TestWorkerEnv(t *testing.T) {
83 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