From 30e33e0ac3109da956d79eab786a317a34888c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 4 Aug 2023 17:38:28 +0200 Subject: [PATCH] test: Caddy module --- caddy/caddy_test.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/caddy/caddy_test.go b/caddy/caddy_test.go index 7e09e55..fc68bb8 100644 --- a/caddy/caddy_test.go +++ b/caddy/caddy_test.go @@ -11,24 +11,31 @@ import ( func TestPHP(t *testing.T) { var wg sync.WaitGroup - caddytest.Default.AdminPort = 2019 tester := caddytest.NewTester(t) tester.InitServer(` { + skip_install_trust admin localhost:2999 http_port 9080 https_port 9443 + + frankenphp } localhost:9080 { - respond "Hello" + route { + php { + root ../testdata + } + } } `, "caddyfile") - wg.Add(100) for i := 0; i < 100; i++ { + wg.Add(1) + go func(i int) { - tester.AssertGetResponse(fmt.Sprintf("http://localhost:9080?i=%d", i), http.StatusOK, fmt.Sprintf("I am by birth a Genevese (%d)", i)) + tester.AssertGetResponse(fmt.Sprintf("http://localhost:9080/index.php?i=%d", i), http.StatusOK, fmt.Sprintf("I am by birth a Genevese (%d)", i)) wg.Done() }(i) }