Fix PHPUnit test, remove unneeded test (function is dynamic)

This commit is contained in:
crazywhalecc 2025-07-29 12:14:31 +08:00
parent 83dae09208
commit df76ecb60f
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 8 additions and 11 deletions

View File

@ -23,6 +23,10 @@ final class GlobalEnvManagerTest extends TestCase
'SPC_TARGET' => getenv('SPC_TARGET'),
'SPC_LIBC' => getenv('SPC_LIBC'),
];
// Temporarily set private GlobalEnvManager::$initialized to false (use reflection)
$reflection = new \ReflectionClass(GlobalEnvManager::class);
$property = $reflection->getProperty('initialized');
$property->setValue(null, false);
}
protected function tearDown(): void
@ -35,6 +39,10 @@ final class GlobalEnvManagerTest extends TestCase
putenv("{$key}={$value}");
}
}
// Temporarily set private GlobalEnvManager::$initialized to false (use reflection)
$reflection = new \ReflectionClass(GlobalEnvManager::class);
$property = $reflection->getProperty('initialized');
$property->setValue(null, true);
}
public function testGetInitializedEnv(): void

View File

@ -34,17 +34,6 @@ final class SPCTargetTest extends TestBase
}
}
/**
* @dataProvider libcProvider
*/
public function testIsStatic(string $libc, bool $expected): void
{
putenv("SPC_LIBC={$libc}");
$result = SPCTarget::isStatic();
$this->assertEquals($expected, $result);
}
/**
* @dataProvider libcProvider
*/