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

Function TestCustomCaddyVariablesInEnv

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

Source from the content-addressed store, hash-verified

409}
410
411func TestCustomCaddyVariablesInEnv(t *testing.T) {
412 tester := caddytest.NewTester(t)
413 initServer(t, tester, `
414 {
415 skip_install_trust
416 admin localhost:2999
417 http_port `+testPort+`
418 https_port 9443
419
420 frankenphp {
421 worker {
422 file ../testdata/worker-env.php
423 num 1
424 env FOO world
425 }
426 }
427 }
428
429 localhost:`+testPort+` {
430 route {
431 map 1 {my_customvar} {
432 default "hello "
433 }
434 php {
435 root ../testdata
436 env FOO {my_customvar}
437 }
438 }
439 }
440 `, "caddyfile")
441
442 tester.AssertGetResponse("http://localhost:"+testPort+"/worker-env.php", http.StatusOK, "hello world")
443}
444
445func TestPHPServerDirective(t *testing.T) {
446 tester := caddytest.NewTester(t)

Callers

nothing calls this directly

Calls 1

initServerFunction · 0.85

Tested by

no test coverage detected