(t *testing.T, opts *testOptions)
| 333 | testRequestSuperGlobal(t, &testOptions{workerScript: "request-superglobal.php", phpIni: phpIni}) |
| 334 | } |
| 335 | func testRequestSuperGlobal(t *testing.T, opts *testOptions) { |
| 336 | runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { |
| 337 | // Test with both GET and POST parameters |
| 338 | // $_REQUEST should contain merged data from both |
| 339 | formData := url.Values{"post_key": {fmt.Sprintf("post_value_%d", i)}} |
| 340 | req := httptest.NewRequest("POST", fmt.Sprintf("http://example.com/request-superglobal.php?get_key=get_value_%d", i), strings.NewReader(formData.Encode())) |
| 341 | req.Header.Set("Content-Type", "application/x-www-form-urlencoded") |
| 342 | body, _ := testRequest(req, handler, t) |
| 343 | |
| 344 | // Verify $_REQUEST contains both GET and POST data for the current request |
| 345 | assert.Contains(t, body, fmt.Sprintf("'get_key' => 'get_value_%d'", i)) |
| 346 | assert.Contains(t, body, fmt.Sprintf("'post_key' => 'post_value_%d'", i)) |
| 347 | }, opts) |
| 348 | } |
| 349 | |
| 350 | func TestRequestSuperGlobalConditional_worker(t *testing.T) { |
| 351 | // This test verifies that $_REQUEST works correctly when accessed conditionally |
no test coverage detected