newDummyContext creates a fake context from a request path
(requestPath string, opts ...RequestOption)
| 106 | |
| 107 | // newDummyContext creates a fake context from a request path |
| 108 | func newDummyContext(requestPath string, opts ...RequestOption) (*frankenPHPContext, error) { |
| 109 | r, err := http.NewRequestWithContext(globalCtx, http.MethodGet, requestPath, nil) |
| 110 | if err != nil { |
| 111 | return nil, err |
| 112 | } |
| 113 | |
| 114 | fr, err := NewRequestWithContext(r, opts...) |
| 115 | if err != nil { |
| 116 | return nil, err |
| 117 | } |
| 118 | |
| 119 | fc, _ := fromContext(fr.Context()) |
| 120 | |
| 121 | return fc, nil |
| 122 | } |
| 123 | |
| 124 | // closeContext sends the response to the client |
| 125 | func (fc *frankenPHPContext) closeContext() { |
no test coverage detected