diff --git a/.github/workflows/behat.yml b/.github/workflows/behat.yml index 0d608b2..bb7efe1 100644 --- a/.github/workflows/behat.yml +++ b/.github/workflows/behat.yml @@ -25,4 +25,6 @@ jobs: run: composer install - name: Run behat - run: vendor/bin/behat + run: | + BEHAT_RUN_AS=$(ls -ld behat.yml | awk '{print $3}') + vendor/bin/behat diff --git a/behat.yml b/behat.yml index 8c62775..ec55888 100644 --- a/behat.yml +++ b/behat.yml @@ -1,3 +1,4 @@ default: extensions: - PhpBuiltin\Server: ~ + PhpBuiltin\Server: + runAs: www-data diff --git a/src/RunServerListener.php b/src/RunServerListener.php index 2972e2b..d4c303b 100644 --- a/src/RunServerListener.php +++ b/src/RunServerListener.php @@ -114,7 +114,10 @@ public function start(): void } if (!$this->isRunning()) { - throw new ServerException('Failed to start server. Is something already running on port ' . self::$port . '?'); + throw new ServerException( + 'Failed to start server. Is something already running on port ' . self::$port . "?\n" . + 'Full command: ' . $fullCmd + ); } register_shutdown_function(function () { @@ -162,7 +165,7 @@ public function killZombies(): void 'grep "php -S ' . self::$host . '"|' . 'grep -v grep|' . 'sed -e "s/^[[:space:]]*//"|cut -d" " -f1'; - $pids = trim(exec($cmd)); + $pids = trim(shell_exec($cmd)); $pids = explode("\n", $pids); foreach ($pids as $pid) { if ($pid) { diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 4e198d3..44c9394 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,8 +1,11 @@ - - - - scalarNode - + + + + shell_exec($cmd) + + + shell_exec($cmd) +