From 9fdc43ec045ee18d81ffe669778dbe49046cd543 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 21 Jul 2026 22:47:32 +0200 Subject: [PATCH] fix: remove class-level .env rename in EncryptionTest to prevent test pollution --- tests/system/Encryption/EncryptionTest.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/system/Encryption/EncryptionTest.php b/tests/system/Encryption/EncryptionTest.php index 48fd6dc78e73..0d99b78ec5b4 100644 --- a/tests/system/Encryption/EncryptionTest.php +++ b/tests/system/Encryption/EncryptionTest.php @@ -35,13 +35,9 @@ public static function setUpBeforeClass(): void CodeIgniterServices::injectMock('superglobals', new Superglobals()); - if (is_file(ROOTPATH . '.env')) { - rename(ROOTPATH . '.env', ROOTPATH . '.env.bak'); - - putenv('encryption.key'); - unset($_ENV['encryption.key']); - service('superglobals')->unsetServer('encryption.key'); - } + putenv('encryption.key'); + unset($_ENV['encryption.key']); + service('superglobals')->unsetServer('encryption.key'); } protected function setUp(): void @@ -51,15 +47,6 @@ protected function setUp(): void $this->encryption = new Encryption(); } - public static function tearDownAfterClass(): void - { - parent::tearDownAfterClass(); - - if (is_file(ROOTPATH . '.env.bak')) { - rename(ROOTPATH . '.env.bak', ROOTPATH . '.env'); - } - } - /** * Covers behavior with config encryption key set or not */