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

Function getAdminResponseBody

caddy/admin_test.go:246–256  ·  view source on GitHub ↗
(t *testing.T, tester *caddytest.Tester, method string, path string)

Source from the content-addressed store, hash-verified

244}
245
246func getAdminResponseBody(t *testing.T, tester *caddytest.Tester, method string, path string) string {
247 adminUrl := "http://localhost:2999/frankenphp/"
248 r, err := http.NewRequest(method, adminUrl+path, nil)
249 assert.NoError(t, err)
250 resp := tester.AssertResponseCode(r, http.StatusOK)
251 defer func() { require.NoError(t, resp.Body.Close()) }()
252 bytes, err := io.ReadAll(resp.Body)
253 assert.NoError(t, err)
254
255 return string(bytes)
256}
257
258func getDebugState(t *testing.T, tester *caddytest.Tester) frankenphp.FrankenPHPDebugState {
259 t.Helper()

Callers 1

getDebugStateFunction · 0.85

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected