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

Function TestWorkerHasOSEnvironmentVariableInSERVER

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

Source from the content-addressed store, hash-verified

143}
144
145func TestWorkerHasOSEnvironmentVariableInSERVER(t *testing.T) {
146 runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
147 req := httptest.NewRequest("GET", "http://example.com/worker.php", nil)
148 w := httptest.NewRecorder()
149 handler(w, req)
150
151 resp := w.Result()
152 body, _ := io.ReadAll(resp.Body)
153
154 assert.Contains(t, string(body), "CUSTOM_OS_ENV_VARIABLE")
155 assert.Contains(t, string(body), "custom_env_variable_value")
156 }, &testOptions{workerScript: "worker.php", nbWorkers: 1, nbParallelRequests: 1})
157}
158
159func TestKeepRunningOnConnectionAbort(t *testing.T) {
160 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