xref: /PHP-8.4/sapi/fpm/tests/gh12385.phpt (revision 6edbbc1c)
1--TEST--
2FPM: GH-12385 - flush with fastcgi does not force headers to be sent
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9
10require_once "tester.inc";
11
12$cfg = <<<EOT
13[global]
14error_log = {{FILE:LOG}}
15[unconfined]
16listen = {{ADDR}}
17pm = static
18pm.max_children = 1
19EOT;
20
21$code = <<<PHP
22<?php
23header("X-Test: 12345");
24flush();
25var_dump(headers_sent());
26PHP;
27
28$tester = new FPM\Tester($cfg, $code);
29$tester->start();
30$tester->expectLogStartNotices();
31$response = $tester->request();
32$response->expectHeader("X-Test", "12345");
33$response->expectBody("bool(true)");
34$tester->terminate();
35$tester->expectLogTerminatingNotices();
36$tester->close();
37
38?>
39Done
40--EXPECT--
41Done
42--CLEAN--
43<?php
44require_once "tester.inc";
45FPM\Tester::clean();
46?>
47