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(15) {
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  ["procs"]=>
72  array(1) {
73    [0]=>
74    array(14) {
75      ["pid"]=>
76      int(%d)
77      ["state"]=>
78      string(7) "Running"
79      ["start-time"]=>
80      int(%d)
81      ["start-since"]=>
82      int(%d)
83      ["requests"]=>
84      int(1)
85      ["request-duration"]=>
86      int(%d)
87      ["request-method"]=>
88      string(3) "GET"
89      ["request-uri"]=>
90      string(%d) "%s"
91      ["query-string"]=>
92      string(0) ""
93      ["request-length"]=>
94      int(0)
95      ["user"]=>
96      string(1) "-"
97      ["script"]=>
98      string(%d) "%s"
99      ["last-request-cpu"]=>
100      float(0)
101      ["last-request-memory"]=>
102      int(0)
103    }
104  }
105}
106Test End
107Done
108--CLEAN--
109<?php
110require_once "tester.inc";
111FPM\Tester::clean();
112?>
113