diff --git a/frankenphp_test.go b/frankenphp_test.go index cbaee146..599559e1 100644 --- a/frankenphp_test.go +++ b/frankenphp_test.go @@ -101,7 +101,9 @@ func testHelloWorld(t *testing.T, opts *testOptions) { } func TestFinishRequest_module(t *testing.T) { testFinishRequest(t, nil) } -func TestFinishRequest_worker(t *testing.T) { testFinishRequest(t, &testOptions{workerScript: "index.php"}) } +func TestFinishRequest_worker(t *testing.T) { + testFinishRequest(t, &testOptions{workerScript: "finish-request.php"}) +} func testFinishRequest(t *testing.T, opts *testOptions) { runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { req := httptest.NewRequest("GET", fmt.Sprintf("http://example.com/finish-request.php?i=%d", i), nil) @@ -110,7 +112,7 @@ func testFinishRequest(t *testing.T, opts *testOptions) { resp := w.Result() body, _ := io.ReadAll(resp.Body) - assert.Equal(t, fmt.Sprintf("This is output\n"), string(body)) + assert.Equal(t, fmt.Sprintf("This is output %d\n", i), string(body)) }, opts) } diff --git a/testdata/finish-request.php b/testdata/finish-request.php index aa602855..2862f813 100644 --- a/testdata/finish-request.php +++ b/testdata/finish-request.php @@ -1,7 +1,11 @@