xref: /PHP-8.4/sapi/fpm/tests/gh16628.phpt (revision 3f1ea1b6)
1--TEST--
2GH-16628 (FPM logs are getting corrupted with this log statement)
3--EXTENSIONS--
4zend_test
5--SKIPIF--
6<?php include "skipif.inc"; ?>
7--FILE--
8<?php
9
10require_once "tester.inc";
11
12$cfg = <<<EOT
13[global]
14error_log = {{FILE:LOG}}
15log_level = debug
16[unconfined]
17listen = {{ADDR}}
18pm = dynamic
19pm.max_children = 5
20pm.start_servers = 1
21pm.min_spare_servers = 1
22pm.max_spare_servers = 3
23catch_workers_output = yes
24decorate_workers_output = no
25EOT;
26
27$code = <<<'EOT'
28<?php
29for ($i = 1; $i < 100; $i++) {
30	zend_test_log_err_debug(str_repeat("a", $i));
31}
32EOT;
33
34$tester = new FPM\Tester($cfg, $code);
35$tester->start(extensions: ['zend_test']);
36$tester->expectLogStartNotices();
37$tester->request()->expectEmptyBody();
38for ($i = 1; $i < 100; $i++) {
39    $tester->expectLogNotice("%sPHP message: " . str_repeat("a", $i));
40}
41$tester->terminate();
42$tester->expectLogTerminatingNotices();
43$tester->close();
44
45?>
46Done
47--EXPECT--
48Done
49--CLEAN--
50<?php
51require_once "tester.inc";
52FPM\Tester::clean();
53?>
54