(t *testing.T, opts *testOptions)
| 507 | testLog_frankenphp_log(t, &testOptions{workerScript: "log-frankenphp_log.php"}) |
| 508 | } |
| 509 | func testLog_frankenphp_log(t *testing.T, opts *testOptions) { |
| 510 | var buf fmt.Stringer |
| 511 | opts.logger, buf = newTestLogger(t) |
| 512 | |
| 513 | runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) { |
| 514 | req := httptest.NewRequest("GET", fmt.Sprintf("http://example.com/log-frankenphp_log.php?i=%d", i), nil) |
| 515 | w := httptest.NewRecorder() |
| 516 | handler(w, req) |
| 517 | |
| 518 | logs := buf.String() |
| 519 | for _, message := range []string{ |
| 520 | `level=INFO msg="default level message"`, |
| 521 | fmt.Sprintf(`level=DEBUG msg="some debug message %d" "key int"=1`, i), |
| 522 | fmt.Sprintf(`level=INFO msg="some info message %d" "key string"=string`, i), |
| 523 | fmt.Sprintf(`level=WARN msg="some warn message %d"`, i), |
| 524 | fmt.Sprintf(`level=ERROR msg="some error message %d" err="[a v]"`, i), |
| 525 | } { |
| 526 | assert.Contains(t, logs, message) |
| 527 | } |
| 528 | }, opts) |
| 529 | } |
| 530 | |
| 531 | func TestConnectionAbort_module(t *testing.T) { testConnectionAbort(t, &testOptions{}) } |
| 532 | func TestConnectionAbort_worker(t *testing.T) { |
no test coverage detected