(t *testing.T)
| 464 | } |
| 465 | |
| 466 | func TestPHPServerDirectiveDisableFileServer(t *testing.T) { |
| 467 | tester := caddytest.NewTester(t) |
| 468 | initServer(t, tester, ` |
| 469 | { |
| 470 | skip_install_trust |
| 471 | admin localhost:2999 |
| 472 | http_port `+testPort+` |
| 473 | https_port 9443 |
| 474 | order php_server before respond |
| 475 | } |
| 476 | |
| 477 | localhost:`+testPort+` { |
| 478 | root ../testdata |
| 479 | php_server { |
| 480 | file_server off |
| 481 | } |
| 482 | respond "Not found" 404 |
| 483 | } |
| 484 | `, "caddyfile") |
| 485 | |
| 486 | tester.AssertGetResponse("http://localhost:"+testPort, http.StatusOK, "I am by birth a Genevese (i not set)") |
| 487 | tester.AssertGetResponse("http://localhost:"+testPort+"/not-found.txt", http.StatusOK, "I am by birth a Genevese (i not set)") |
| 488 | } |
| 489 | |
| 490 | func TestPHPServerGlobals(t *testing.T) { |
| 491 | documentRoot, _ := filepath.Abs("../testdata") |
nothing calls this directly
no test coverage detected