log-bwd-msg-with-nl.phpt 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. FPM: Buffered worker output decorated log with msg containing new lines
  3. --SKIPIF--
  4. <?php include "skipif.inc"; ?>
  5. --FILE--
  6. <?php
  7. require_once "tester.inc";
  8. $cfg = <<<EOT
  9. [global]
  10. error_log = {{FILE:LOG}}
  11. [unconfined]
  12. listen = {{ADDR}}
  13. pm = dynamic
  14. pm.max_children = 5
  15. pm.start_servers = 1
  16. pm.min_spare_servers = 1
  17. pm.max_spare_servers = 3
  18. catch_workers_output = yes
  19. EOT;
  20. $code = <<<EOT
  21. <?php
  22. file_put_contents('php://stderr', "msg 1\nmsg 2\nmsg 3");
  23. EOT;
  24. $tester = new FPM\Tester($cfg, $code);
  25. $tester->start();
  26. $tester->expectLogStartNotices();
  27. $tester->request()->expectEmptyBody();
  28. $tester->expectLogLine('msg 1');
  29. $tester->expectLogLine('msg 2');
  30. $tester->expectLogLine('msg 3');
  31. $tester->terminate();
  32. $tester->expectLogTerminatingNotices();
  33. $tester->close();
  34. ?>
  35. Done
  36. --EXPECT--
  37. Done
  38. --CLEAN--
  39. <?php
  40. require_once "tester.inc";
  41. FPM\Tester::clean();
  42. ?>