fix: harden portable host installation
This commit is contained in:
@@ -11,6 +11,13 @@ unlink($tempEnv);
|
||||
if (getenv('JOBcard_LOADED') !== 'from-file') {
|
||||
throw new RuntimeException('Expected .env values to load from file');
|
||||
}
|
||||
$invalidEnv = tempnam(sys_get_temp_dir(), 'jobcard-env-invalid-');
|
||||
file_put_contents($invalidEnv, "NOT A NAME=should-not-load\nJOBcard_VALID=ok\n");
|
||||
load_dotenv($invalidEnv);
|
||||
unlink($invalidEnv);
|
||||
if (getenv('NOT A NAME') !== false || getenv('JOBcard_VALID') !== 'ok') {
|
||||
throw new RuntimeException('Expected malformed .env names to be ignored');
|
||||
}
|
||||
|
||||
$checks = 0;
|
||||
assert(env_required('JOBcard_TEST_VALUE') === 'present');
|
||||
|
||||
Reference in New Issue
Block a user