MCPcopy Index your code
hub / github.com/php/frankenphp / TestPHPServerDirectiveDisableFileServer

Function TestPHPServerDirectiveDisableFileServer

caddy/caddy_test.go:466–488  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

464}
465
466func 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
490func TestPHPServerGlobals(t *testing.T) {
491 documentRoot, _ := filepath.Abs("../testdata")

Callers

nothing calls this directly

Calls 1

initServerFunction · 0.85

Tested by

no test coverage detected