2222use PHPUnit \Framework \Attributes \PreserveGlobalState ;
2323use PHPUnit \Framework \Attributes \RunInSeparateProcess ;
2424use PHPUnit \Framework \Attributes \WithoutErrorHandler ;
25- use TypeError ;
2625
2726/**
2827 * @internal
@@ -90,6 +89,9 @@ public static function provideLoadsVars(): iterable
9089 #[RunInSeparateProcess]
9190 public function testLoadsHex2Bin (): void
9291 {
92+ putenv ('encryption.key ' );
93+ unset($ _ENV ['encryption.key ' ], $ _SERVER ['encryption.key ' ]); // @phpstan-ignore codeigniter.superglobalAccess
94+
9395 $ dotenv = new DotEnv ($ this ->fixturesFolder , 'encryption.env ' );
9496 $ dotenv ->load ();
9597
@@ -102,20 +104,16 @@ public function testLoadsHex2Bin(): void
102104 #[RunInSeparateProcess]
103105 public function testLoadsBase64 (): void
104106 {
107+ putenv ('encryption.key ' );
108+ unset($ _ENV ['encryption.key ' ], $ _SERVER ['encryption.key ' ]); // @phpstan-ignore codeigniter.superglobalAccess
109+
105110 $ dotenv = new DotEnv ($ this ->fixturesFolder , 'base64encryption.env ' );
106111 $ dotenv ->load ();
107112
108113 $ this ->assertSame ('base64:L40bKo6b8Nu541LeVeZ1i5RXfGgnkar42CPTfukhGhw= ' , getenv ('encryption.key ' ));
109114 $ this ->assertSame ('OpenSSL ' , getenv ('encryption.driver ' ));
110115 }
111116
112- public function testLoadsNoneStringFiles (): void
113- {
114- $ this ->expectException (TypeError::class);
115-
116- new DotEnv ($ this ->fixturesFolder , 2 );
117- }
118-
119117 public function testCommentedLoadsVars (): void
120118 {
121119 $ dotenv = new DotEnv ($ this ->fixturesFolder , 'commented.env ' );
0 commit comments