diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index 0ba70346de4c..9158db34140f 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -197,6 +197,9 @@ public function testSetsDefaultValues(): void #[RunInSeparateProcess] public function testSetsDefaultValuesEncryptionUsingHex2Bin(): void { + putenv('encryption.key'); + unset($_ENV['encryption.key'], $_SERVER['encryption.key']); // @phpstan-ignore codeigniter.superglobalAccess + $dotenv = new DotEnv($this->fixturesFolder, 'encryption.env'); $dotenv->load(); $config = new Encryption(); @@ -210,6 +213,9 @@ public function testSetsDefaultValuesEncryptionUsingHex2Bin(): void #[RunInSeparateProcess] public function testSetDefaultValuesEncryptionUsingBase64(): void { + putenv('encryption.key'); + unset($_ENV['encryption.key'], $_SERVER['encryption.key']); // @phpstan-ignore codeigniter.superglobalAccess + $dotenv = new DotEnv($this->fixturesFolder, 'base64encryption.env'); $dotenv->load(); $config = new Encryption('base64'); diff --git a/tests/system/Config/DotEnvTest.php b/tests/system/Config/DotEnvTest.php index 6fd287be6ad5..97bf2e3dd026 100644 --- a/tests/system/Config/DotEnvTest.php +++ b/tests/system/Config/DotEnvTest.php @@ -90,6 +90,9 @@ public static function provideLoadsVars(): iterable #[RunInSeparateProcess] public function testLoadsHex2Bin(): void { + putenv('encryption.key'); + unset($_ENV['encryption.key'], $_SERVER['encryption.key']); // @phpstan-ignore codeigniter.superglobalAccess + $dotenv = new DotEnv($this->fixturesFolder, 'encryption.env'); $dotenv->load(); @@ -102,6 +105,9 @@ public function testLoadsHex2Bin(): void #[RunInSeparateProcess] public function testLoadsBase64(): void { + putenv('encryption.key'); + unset($_ENV['encryption.key'], $_SERVER['encryption.key']); // @phpstan-ignore codeigniter.superglobalAccess + $dotenv = new DotEnv($this->fixturesFolder, 'base64encryption.env'); $dotenv->load();