1--TEST--
2FPM: Buffered worker output decorated log with msg containing new lines
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
21EOT;
22
23$code = <<<EOT
24<?php
25file_put_contents('php://stderr', "msg 1\nmsg 2\nmsg 3");
26EOT;
27
28$tester = new FPM\Tester($cfg, $code);
29$tester->start();
30$tester->expectLogStartNotices();
31$tester->request()->expectEmptyBody();
32$tester->expectLogLine('msg 1');
33$tester->expectLogLine('msg 2');
34$tester->expectLogLine('msg 3');
35$tester->terminate();
36$tester->expectLogTerminatingNotices();
37$tester->close();
38
39?>
40Done
41--EXPECT--
42Done
43--CLEAN--
44<?php
45require_once "tester.inc";
46FPM\Tester::clean();
47?>
48