Skip to content

Commit a72c0d5

Browse files
authored
Merge pull request #402 from mbeccati/skip-no-known-php-config
Skip test with no known /usr/bin/php-configX.Y
2 parents a7df737 + bb80aa6 commit a72c0d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unit/Platform/TargetPhp/PhpBinaryPathTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public static function phpConfigPathProvider(): array
135135
&& is_executable($phpConfigPath[0]),
136136
);
137137

138+
if ($possiblePhpConfigPaths === []) {
139+
return ['skip' => ['skip', 'skip']];
140+
}
141+
138142
return array_combine(
139143
array_column($possiblePhpConfigPaths, 0),
140144
$possiblePhpConfigPaths,
@@ -148,6 +152,10 @@ public function testFromPhpConfigExecutable(string $phpConfigPath, string $expec
148152
self::markTestSkipped('Do not need to test php-config on Windows as we are not building on Windows.');
149153
}
150154

155+
if ($expectedMajorMinor === 'skip') {
156+
self::markTestSkipped('No known system php-config could be found.');
157+
}
158+
151159
assert($phpConfigPath !== '');
152160
$phpBinary = PhpBinaryPath::fromPhpConfigExecutable($phpConfigPath);
153161

0 commit comments

Comments
 (0)