Add FPM FCGI env Apache handler UDS test

This commit is contained in:
Jakub Zelenka 2023-04-07 12:28:42 +01:00
parent 15802dfc62
commit ebb3213f79
No known key found for this signature in database
GPG key ID: 1C0779DC5C0A9DE4
2 changed files with 54 additions and 1 deletions

View file

@ -0,0 +1,53 @@
--TEST--
FPM: FastCGI env var path info fix for Apache handler using Unix Domain Socket
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php
require_once "tester.inc";
$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR:UDS}}
pm = dynamic
pm.max_children = 5
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
php_admin_value[cgi.fix_pathinfo] = yes
EOT;
$code = <<<EOT
<?php
echo \$_SERVER["SCRIPT_NAME"] . "\n";
echo \$_SERVER["SCRIPT_FILENAME"] . "\n";
echo \$_SERVER["PHP_SELF"];
EOT;
$tester = new FPM\Tester($cfg, $code);
[$sourceFilePath, $scriptName] = $tester->createSourceFileAndScriptName();
$tester->start();
$tester->expectLogStartNotices();
$tester
->request(
uri: $scriptName,
address: '{{ADDR:UDS}}',
scriptFilename: "proxy:fcgi://localhost" . $sourceFilePath,
scriptName: $scriptName,
)
->expectBody([$scriptName, $sourceFilePath, $scriptName]);
$tester->terminate();
$tester->close();
?>
Done
--EXPECT--
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>

View file

@ -1,5 +1,5 @@
--TEST-- --TEST--
FPM: FastCGI env var path info fix for Apache handler basic FPM: FastCGI env var path info fix for Apache handler with PATH_INFO set
--SKIPIF-- --SKIPIF--
<?php include "skipif.inc"; ?> <?php include "skipif.inc"; ?>
--FILE-- --FILE--