(t *testing.T, opts *testOptions)
| 444 | func TestPhpInfo_module(t *testing.T) { testPhpInfo(t, nil) } |
| 445 | func TestPhpInfo_worker(t *testing.T) { testPhpInfo(t, &testOptions{workerScript: "phpinfo.php"}) } |
| 446 | func testPhpInfo(t *testing.T, opts *testOptions) { |
| 447 | var logOnce sync.Once |
| 448 | runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { |
| 449 | body, _ := testGet(fmt.Sprintf("http://example.com/phpinfo.php?i=%d", i), handler, t) |
| 450 | |
| 451 | logOnce.Do(func() { |
| 452 | t.Log(body) |
| 453 | }) |
| 454 | |
| 455 | assert.Contains(t, body, "frankenphp") |
| 456 | assert.Contains(t, body, fmt.Sprintf("i=%d", i)) |
| 457 | }, opts) |
| 458 | } |
| 459 | |
| 460 | func TestPersistentObject_module(t *testing.T) { testPersistentObject(t, nil) } |
| 461 | func TestPersistentObject_worker(t *testing.T) { |
no test coverage detected