diff --git a/sapi/fpm/tests/bug77780-header-sent-error.phpt b/sapi/fpm/tests/bug77780-header-sent-error.phpt index b5e76918547..017a2aa513c 100644 --- a/sapi/fpm/tests/bug77780-header-sent-error.phpt +++ b/sapi/fpm/tests/bug77780-header-sent-error.phpt @@ -24,7 +24,7 @@ echo str_repeat('asdfghjkl', 150000) . "\n"; EOT; $tester = new FPM\Tester($cfg, $code); -$tester->start(); +$tester->start(extensions: ['session']); $tester->expectLogStartNotices(); $tester ->request( diff --git a/sapi/fpm/tests/tester.inc b/sapi/fpm/tests/tester.inc index 0bb114e8597..ae60114f78f 100644 --- a/sapi/fpm/tests/tester.inc +++ b/sapi/fpm/tests/tester.inc @@ -379,12 +379,17 @@ class Tester * @param array $extraArgs Command extra arguments. * @param bool $forceStderr Whether to output to stderr so error log is used. * @param bool $daemonize Whether to start FPM daemonized + * @param array $extensions List of extension to add if shared build used. * * @return bool * @throws \Exception */ - public function start(array $extraArgs = [], bool $forceStderr = true, bool $daemonize = false) - { + public function start( + array $extraArgs = [], + bool $forceStderr = true, + bool $daemonize = false, + array $extensions = [] + ) { $configFile = $this->createConfig(); $desc = $this->outDesc ? [] : [1 => array('pipe', 'w'), 2 => array('redirect', 1)]; @@ -399,6 +404,14 @@ class Tester $cmd[] = '-F'; } + $extensionDir = getenv('TEST_FPM_EXTENSION_DIR'); + if ($extensionDir) { + $cmd[] = '-dextension_dir=' . $extensionDir; + foreach ($extensions as $extension) { + $cmd[] = '-dextension=' . $extension; + } + } + if (getenv('TEST_FPM_RUN_AS_ROOT')) { $cmd[] = '--allow-to-run-as-root'; }