mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
Fix PHPUnit test on Windows, ignore calling linux system util for other OS
This commit is contained in:
parent
451de4a6f6
commit
6b23f4b34a
@ -99,8 +99,11 @@ class SPCTarget
|
|||||||
*/
|
*/
|
||||||
public static function getLibcVersion(): ?string
|
public static function getLibcVersion(): ?string
|
||||||
{
|
{
|
||||||
$libc = self::getLibc();
|
if (PHP_OS_FAMILY === 'Linux') {
|
||||||
return SystemUtil::getLibcVersionIfExists($libc);
|
$libc = self::getLibc();
|
||||||
|
return SystemUtil::getLibcVersionIfExists($libc);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -19,6 +19,10 @@ final class PkgConfigUtilTest extends TestCase
|
|||||||
|
|
||||||
public static function setUpBeforeClass(): void
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
|
if (PHP_OS_FAMILY === 'Windows') {
|
||||||
|
// Skip tests on Windows as pkg-config is not typically available
|
||||||
|
self::markTestSkipped('PkgConfigUtil tests are not applicable on Windows.');
|
||||||
|
}
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
|
|
||||||
// Save original PATH
|
// Save original PATH
|
||||||
|
|||||||
@ -21,6 +21,10 @@ class SPCConfigUtilTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass(): void
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
|
if (PHP_OS_FAMILY === 'Windows') {
|
||||||
|
// Skip tests on Windows as SPCConfigUtil is not applicable
|
||||||
|
self::markTestSkipped('SPCConfigUtil tests are not applicable on Windows.');
|
||||||
|
}
|
||||||
$testdir = WORKING_DIR . '/.configtest';
|
$testdir = WORKING_DIR . '/.configtest';
|
||||||
FileSystem::createDir($testdir);
|
FileSystem::createDir($testdir);
|
||||||
FileSystem::writeFile($testdir . '/lib.json', file_get_contents(ROOT_DIR . '/config/lib.json'));
|
FileSystem::writeFile($testdir . '/lib.json', file_get_contents(ROOT_DIR . '/config/lib.json'));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user