[Dotenv] FIX missing getenv
This commit is contained in:
parent
e85acddc9a
commit
9c5754acaa
@ -387,7 +387,7 @@ final class Dotenv
|
||||
} elseif (isset($this->values[$name])) {
|
||||
$value = $this->values[$name];
|
||||
} else {
|
||||
$value = '';
|
||||
$value = (string) getenv($name);
|
||||
}
|
||||
|
||||
if (!$matches['opening_brace'] && isset($matches['closing_brace'])) {
|
||||
|
@ -314,4 +314,15 @@ class DotenvTest extends TestCase
|
||||
$this->assertSame('foo2_prod', $values['TEST2']);
|
||||
}
|
||||
}
|
||||
|
||||
public function testGetVariablesValueFromGetenv()
|
||||
{
|
||||
putenv('Foo=Bar');
|
||||
|
||||
$dotenv = new Dotenv(true);
|
||||
$values = $dotenv->parse('Foo=${Foo}');
|
||||
$this->assertSame('Bar', $values['Foo']);
|
||||
|
||||
putenv('Foo');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user