1--TEST--
2FPM: bug69625 - 404 should be returned on missing SCRIPT_FILENAME
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\n";
25EOT;
26
27$tester = new FPM\Tester($cfg, $code);
28$tester->start();
29$tester->expectLogStartNotices();
30$tester
31    ->request('', ['SCRIPT_FILENAME' => null])
32    ->expectHeader('Status', '404 Not Found')
33    ->expectError('Primary script unknown');
34$tester->terminate();
35$tester->close();
36
37?>
38Done
39--EXPECT--
40Done
41--CLEAN--
42<?php
43require_once "tester.inc";
44FPM\Tester::clean();
45?>
46