@@ -727,6 +727,7 @@ public static function validCsv()
727
727
public function testEnvLoader ()
728
728
{
729
729
$ _ENV ['BAZ_ENV_LOADER ' ] = '' ;
730
+ $ _ENV ['BUZ_ENV_LOADER ' ] = '' ;
730
731
731
732
$ loaders = function () {
732
733
yield new class () implements EnvVarLoaderInterface {
@@ -751,7 +752,7 @@ public function loadEnvVars(): array
751
752
};
752
753
};
753
754
754
- $ processor = new EnvVarProcessor (new Container (), $ loaders( ));
755
+ $ processor = new EnvVarProcessor (new Container (), new RewindableGenerator ( $ loaders, 2 ));
755
756
756
757
$ result = $ processor ->getEnv ('string ' , 'FOO_ENV_LOADER ' , function () {});
757
758
$ this ->assertSame ('123 ' , $ result );
@@ -762,10 +763,14 @@ public function loadEnvVars(): array
762
763
$ result = $ processor ->getEnv ('string ' , 'BAZ_ENV_LOADER ' , function () {});
763
764
$ this ->assertSame ('567 ' , $ result );
764
765
766
+ $ result = $ processor ->getEnv ('string ' , 'BUZ_ENV_LOADER ' , function () {});
767
+ $ this ->assertSame ('' , $ result );
768
+
765
769
$ result = $ processor ->getEnv ('string ' , 'FOO_ENV_LOADER ' , function () {});
766
770
$ this ->assertSame ('123 ' , $ result ); // check twice
767
771
768
772
unset($ _ENV ['BAZ_ENV_LOADER ' ]);
773
+ unset($ _ENV ['BUZ_ENV_LOADER ' ]);
769
774
}
770
775
771
776
public function testCircularEnvLoader ()
0 commit comments