mirror of
https://github.com/dunglas/frankenphp
synced 2024-10-16 17:14:59 +00:00
test: Caddy module
This commit is contained in:
parent
3cc9650632
commit
30e33e0ac3
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user