1--TEST--
2FPM: Buffered worker output plain log with msg with flush split in buffer
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
20catch_workers_output = yes
21decorate_workers_output = no
22EOT;
23
24$code = <<<EOT
25<?php
26file_put_contents('php://stderr', str_repeat('a', 1021) . "\0fabc");
27EOT;
28
29$tester = new FPM\Tester($cfg, $code);
30$tester->start();
31$tester->expectLogStartNotices();
32$tester->request()->expectEmptyBody();
33$lines = $tester->getLogLines(2);
34var_dump($lines[0] === str_repeat('a', 1021)  . "\0f\n");
35var_dump($lines[1] === "abc\n");
36$tester->terminate();
37$tester->expectLogTerminatingNotices();
38$tester->close();
39
40?>
41Done
42--EXPECT--
43bool(true)
44bool(true)
45Done
46--CLEAN--
47<?php
48require_once "tester.inc";
49FPM\Tester::clean();
50?>
51