(b *testing.B)
| 833 | } |
| 834 | |
| 835 | func BenchmarkHelloWorld(b *testing.B) { |
| 836 | require.NoError(b, frankenphp.Init()) |
| 837 | b.Cleanup(frankenphp.Shutdown) |
| 838 | |
| 839 | cwd, _ := os.Getwd() |
| 840 | testDataDir := cwd + "/testdata/" |
| 841 | |
| 842 | opt := frankenphp.WithRequestDocumentRoot(testDataDir, false) |
| 843 | handler := func(w http.ResponseWriter, r *http.Request) { |
| 844 | req, err := frankenphp.NewRequestWithContext(r, opt) |
| 845 | require.NoError(b, err) |
| 846 | |
| 847 | require.NoError(b, frankenphp.ServeHTTP(w, req)) |
| 848 | } |
| 849 | |
| 850 | req := httptest.NewRequest("GET", "http://example.com/index.php", nil) |
| 851 | w := httptest.NewRecorder() |
| 852 | |
| 853 | for b.Loop() { |
| 854 | handler(w, req) |
| 855 | } |
| 856 | } |
| 857 | |
| 858 | func BenchmarkEcho(b *testing.B) { |
| 859 | require.NoError(b, frankenphp.Init()) |
nothing calls this directly
no test coverage detected