1--TEST--
2FPM: php_admin_value doc_root usage
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8require_once "tester.inc";
9
10$docRoot = __DIR__ . '/';
11
12$cfg = <<<EOT
13[global]
14error_log = {{FILE:LOG}}
15[unconfined]
16listen = {{ADDR}}
17pm = dynamic
18pm.max_children = 5
19pm.start_servers = 1
20pm.min_spare_servers = 1
21pm.max_spare_servers = 3
22php_admin_value[doc_root] = $docRoot
23EOT;
24
25$code = <<<EOT
26<?php
27echo "OK";
28EOT;
29
30$tester = new FPM\Tester($cfg, $code);
31$sourceFile = $tester->makeSourceFile();
32$tester->start();
33$tester->expectLogStartNotices();
34$tester->request(uri: basename($sourceFile), scriptFilename: $sourceFile)->expectBody('OK');
35$tester->terminate();
36$tester->close();
37
38?>
39Done
40--EXPECT--
41Done
42--CLEAN--
43<?php
44require_once "tester.inc";
45FPM\Tester::clean();
46?>
47