1--TEST--
2FPM: UNIX socket filename is too for test
3--SKIPIF--
4<?php
5include "skipif.inc"; ?>
6--FILE--
7<?php
8
9require_once "tester.inc";
10
11$socketFilePrefix = __DIR__ . '/socket-file';
12$socketFile = sprintf(
13    "/this-socket-very-very-very-long-file-fpm-unix-socket-is-too-long-filename-but-starts-anyway%s.sock",
14    __DIR__,
15    str_repeat('-0000', 11)
16);
17
18$cfg = <<<EOT
19[global]
20error_log = {{FILE:LOG}}
21
22[fpm_pool]
23listen = $socketFile
24pm = static
25pm.max_children = 1
26catch_workers_output = yes
27EOT;
28
29$tester = new FPM\Tester($cfg);
30$tester->testConfig(true, [
31    sprintf(
32        '/cannot bind to UNIX socket \'%s\' as path is too long '
33            . '\(found length: %d, maximal length: \d+\)/',
34        preg_quote($socketFile, '/'),
35        strlen($socketFile)
36    ),
37    '/FPM initialization failed/',
38]);
39?>
40Done
41--EXPECT--
42Done
43--CLEAN--
44<?php
45require_once "tester.inc";
46FPM\Tester::clean();
47?>
48