Skip to content

Commit

Permalink
phpinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jul 3, 2023
1 parent f5e6b8c commit 8add4d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frankenphp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ func testSession(t *testing.T, opts *testOptions) {
func TestPhpInfo_module(t *testing.T) { testPhpInfo(t, nil) }
func TestPhpInfo_worker(t *testing.T) { testPhpInfo(t, &testOptions{workerScript: "phpinfo.php"}) }
func testPhpInfo(t *testing.T, opts *testOptions) {
var logOnce sync.Once
runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
req := httptest.NewRequest("GET", fmt.Sprintf("http://example.com/phpinfo.php?i=%d", i), nil)
w := httptest.NewRecorder()
Expand All @@ -343,6 +344,10 @@ func testPhpInfo(t *testing.T, opts *testOptions) {
resp := w.Result()
body, _ := io.ReadAll(resp.Body)

logOnce.Do(func() {
t.Log(string(body))
})

assert.Contains(t, string(body), "frankenphp")
assert.Contains(t, string(body), fmt.Sprintf("i=%d", i))
}, opts)
Expand Down

0 comments on commit 8add4d9

Please sign in to comment.