1--TEST--
2FPM: GHSA-54hq-v5wp-fqgv - max_multipart_body_parts ini default
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8require_once "tester.inc";
9
10$cfg = <<<EOT
11[global]
12error_log = {{FILE:LOG}}
13[unconfined]
14listen = {{ADDR}}
15pm = dynamic
16pm.max_children = 5
17pm.start_servers = 1
18pm.min_spare_servers = 1
19pm.max_spare_servers = 3
20php_admin_value[html_errors] = false
21php_admin_value[max_input_vars] = 20
22php_admin_value[max_file_uploads] = 5
23php_admin_flag[display_errors] = On
24php_admin_flag[display_startup_errors] = On
25php_admin_flag[log_errors] = On
26EOT;
27
28$code = <<<EOT
29<?php
30var_dump(count(\$_POST));
31EOT;
32
33$tester = new FPM\Tester($cfg, $code);
34$tester->start();
35$tester->expectLogStartNotices();
36echo $tester
37    ->request(stdin: [
38        'parts' => [
39            'count' => 30,
40        ]
41    ])
42    ->getBody();
43$tester->terminate();
44$tester->close();
45
46?>
47--EXPECT--
48Warning: PHP Request Startup: Input variables exceeded 20. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
49
50Warning: PHP Request Startup: Multipart body parts limit exceeded 25. To increase the limit change max_multipart_body_parts in php.ini. in Unknown on line 0
51int(20)
52--CLEAN--
53<?php
54require_once "tester.inc";
55FPM\Tester::clean();
56?>
57