1--TEST--
2FPM: Function fpm_get_status basic test
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
20EOT;
21
22$code = <<<EOT
23<?php
24echo "Test Start\n";
25var_dump(fpm_get_status());
26echo "Test End\n";
27EOT;
28
29$headers = [];
30$tester = new FPM\Tester($cfg, $code);
31$tester->start();
32$tester->expectLogStartNotices();
33$tester->request()->printBody();
34$tester->terminate();
35$tester->expectLogTerminatingNotices();
36$tester->close();
37
38?>
39Done
40--EXPECTF--
41Test Start
42array(16) {
43  ["pool"]=>
44  string(10) "unconfined"
45  ["process-manager"]=>
46  string(7) "dynamic"
47  ["start-time"]=>
48  int(%d)
49  ["start-since"]=>
50  int(%d)
51  ["accepted-conn"]=>
52  int(1)
53  ["listen-queue"]=>
54  int(0)
55  ["max-listen-queue"]=>
56  int(0)
57  ["listen-queue-len"]=>
58  int(%d)
59  ["idle-processes"]=>
60  int(0)
61  ["active-processes"]=>
62  int(1)
63  ["total-processes"]=>
64  int(1)
65  ["max-active-processes"]=>
66  int(1)
67  ["max-children-reached"]=>
68  int(0)
69  ["slow-requests"]=>
70  int(0)
71  ["memory-peak"]=>
72  int(0)
73  ["procs"]=>
74  array(1) {
75    [0]=>
76    array(14) {
77      ["pid"]=>
78      int(%d)
79      ["state"]=>
80      string(7) "Running"
81      ["start-time"]=>
82      int(%d)
83      ["start-since"]=>
84      int(%d)
85      ["requests"]=>
86      int(1)
87      ["request-duration"]=>
88      int(%d)
89      ["request-method"]=>
90      string(3) "GET"
91      ["request-uri"]=>
92      string(%d) "%s"
93      ["query-string"]=>
94      string(0) ""
95      ["request-length"]=>
96      int(0)
97      ["user"]=>
98      string(1) "-"
99      ["script"]=>
100      string(%d) "%s"
101      ["last-request-cpu"]=>
102      float(0)
103      ["last-request-memory"]=>
104      int(0)
105    }
106  }
107}
108Test End
109Done
110--CLEAN--
111<?php
112require_once "tester.inc";
113FPM\Tester::clean();
114?>
115