xref: /PHP-8.3/sapi/fpm/tests/bug78323.phpt (revision fd08f062)
1--TEST--
2FPM: Bug #78323 Test exit code for invalid parameters
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8require_once "tester.inc";
9
10$php = \FPM\Tester::findExecutable();
11
12// no argument for option
13ob_start();
14passthru("$php --memory-limit=1G 2>&1", $exitCode);
15$output = ob_get_contents();
16ob_end_clean();
17
18$lines = preg_split('/\R/', $output);
19echo $lines[0], "\n",
20     "Done: $exitCode\n\n";
21
22
23// Successful execution
24ob_start();
25passthru("$php -dmemory-limit=1G -v", $exitCode);
26$output = ob_get_contents();
27ob_end_clean();
28
29$lines = preg_split('/\R/', $output);
30echo $lines[0], "\n",
31     "Done: $exitCode\n";
32
33?>
34--EXPECTF--
35Usage: %s
36Done: 64
37
38PHP %s
39Done: 0
40