xref: /PHP-8.0/sapi/fpm/tests/status-basic.phpt (revision f8d79582)
1--TEST--
2FPM: 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 = static
16pm.max_children = 1
17pm.status_path = /status
18EOT;
19
20$expectedStatusData = [
21    'pool'                 => 'unconfined',
22    'process manager'      => 'static',
23    'listen queue'         => 0,
24    'max listen queue'     => 0,
25    'idle processes'       => 0,
26    'active processes'     => 1,
27    'total processes'      => 1,
28    'max active processes' => 1,
29    'max children reached' => 0,
30    'slow requests'        => 0,
31];
32
33$tester = new FPM\Tester($cfg);
34$tester->start();
35$tester->expectLogStartNotices();
36$tester->request()->expectEmptyBody();
37$tester->status($expectedStatusData);
38$tester->terminate();
39$tester->expectLogTerminatingNotices();
40$tester->close();
41
42?>
43Done
44--EXPECT--
45Done
46--CLEAN--
47<?php
48require_once "tester.inc";
49FPM\Tester::clean();
50?>
51