1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/sapi/fpm/tests/php-admin-doc-root.phpt
2021-11-23 18:36:04 +01:00

47 lines
779 B
PHP

--TEST--
FPM: php_admin_value doc_root usage
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php
require_once "tester.inc";
$docRoot = __DIR__ . '/';
$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR}}
pm = dynamic
pm.max_children = 5
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
php_admin_value[doc_root] = $docRoot
EOT;
$code = <<<EOT
<?php
echo "OK";
EOT;
$tester = new FPM\Tester($cfg, $code);
$sourceFile = $tester->makeSourceFile();
$tester->start();
$tester->expectLogStartNotices();
$tester->request(uri: basename($sourceFile), scriptFilename: $sourceFile)->expectBody('OK');
$tester->terminate();
$tester->close();
?>
Done
--EXPECT--
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>