diff --git a/test/unit/Platform/TargetPhp/PhpBinaryPathTest.php b/test/unit/Platform/TargetPhp/PhpBinaryPathTest.php index 8aeb4d05..acd93e7f 100644 --- a/test/unit/Platform/TargetPhp/PhpBinaryPathTest.php +++ b/test/unit/Platform/TargetPhp/PhpBinaryPathTest.php @@ -135,6 +135,10 @@ public static function phpConfigPathProvider(): array && is_executable($phpConfigPath[0]), ); + if ($possiblePhpConfigPaths === []) { + return ['skip' => ['skip', 'skip']]; + } + return array_combine( array_column($possiblePhpConfigPaths, 0), $possiblePhpConfigPaths, @@ -148,6 +152,10 @@ public function testFromPhpConfigExecutable(string $phpConfigPath, string $expec self::markTestSkipped('Do not need to test php-config on Windows as we are not building on Windows.'); } + if ($expectedMajorMinor === 'skip') { + self::markTestSkipped('No known system php-config could be found.'); + } + assert($phpConfigPath !== ''); $phpBinary = PhpBinaryPath::fromPhpConfigExecutable($phpConfigPath);