(t *testing.T)
| 443 | } |
| 444 | |
| 445 | func TestPHPServerDirective(t *testing.T) { |
| 446 | tester := caddytest.NewTester(t) |
| 447 | initServer(t, tester, ` |
| 448 | { |
| 449 | skip_install_trust |
| 450 | admin localhost:2999 |
| 451 | http_port `+testPort+` |
| 452 | https_port 9443 |
| 453 | } |
| 454 | |
| 455 | localhost:`+testPort+` { |
| 456 | root ../testdata |
| 457 | php_server |
| 458 | } |
| 459 | `, "caddyfile") |
| 460 | |
| 461 | tester.AssertGetResponse("http://localhost:"+testPort, http.StatusOK, "I am by birth a Genevese (i not set)") |
| 462 | tester.AssertGetResponse("http://localhost:"+testPort+"/hello.txt", http.StatusOK, "Hello\n") |
| 463 | tester.AssertGetResponse("http://localhost:"+testPort+"/not-found.txt", http.StatusOK, "I am by birth a Genevese (i not set)") |
| 464 | } |
| 465 | |
| 466 | func TestPHPServerDirectiveDisableFileServer(t *testing.T) { |
| 467 | tester := caddytest.NewTester(t) |
nothing calls this directly
no test coverage detected