From bb80aa6e0cf412b9a708df35d1a365ebe5bb4b5c Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Fri, 31 Oct 2025 09:29:25 +0100 Subject: [PATCH] Skip test with no known /usr/bin/php-configX.Y --- test/unit/Platform/TargetPhp/PhpBinaryPathTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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);