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

Function assertRequestBody

phpmainthread_test.go:234–245  ·  view source on GitHub ↗
(t *testing.T, url string, expected string)

Source from the content-addressed store, hash-verified

232}
233
234func assertRequestBody(t *testing.T, url string, expected string) {
235 r := httptest.NewRequest("GET", url, nil)
236 w := httptest.NewRecorder()
237
238 req, err := NewRequestWithContext(r, WithRequestDocumentRoot(testDataPath, false))
239 assert.NoError(t, err)
240 err = ServeHTTP(w, req)
241 assert.NoError(t, err)
242 resp := w.Result()
243 body, _ := io.ReadAll(resp.Body)
244 assert.Equal(t, expected, string(body))
245}
246
247// create a mix of possible transitions of workers and regular threads
248func allPossibleTransitions(worker1Path string, worker2Path string) []func(*phpThread) {

Calls 4

NewRequestWithContextFunction · 0.85
WithRequestDocumentRootFunction · 0.85
ServeHTTPFunction · 0.85
ResultMethod · 0.80

Tested by

no test coverage detected