3636use Tempest \Storage \Testing \StorageTester ;
3737use Throwable ;
3838
39+ use function Tempest \env ;
3940use function Tempest \Support \Path \normalize ;
4041use function Tempest \Support \Path \to_absolute_path ;
4142
@@ -46,6 +47,8 @@ abstract class IntegrationTest extends TestCase
4647{
4748 protected string $ root ;
4849
50+ protected string $ internalStorage ;
51+
4952 /** @var \Tempest\Discovery\DiscoveryLocation[] */
5053 protected array $ discoveryLocations = [];
5154
@@ -110,12 +113,14 @@ protected function setupKernel(): self
110113 {
111114 // We force forward slashes for consistency even on Windows.
112115 $ this ->root ??= normalize (realpath (getcwd ()));
116+ $ this ->internalStorage = $ this ->root . '/.tempest/test_internal_storage/ ' . env ('TEST_TOKEN ' , 'default ' );
113117
114118 $ discoveryLocations = [...$ this ->discoveryLocations , ...$ this ->discoverTestLocations ()];
115119
116120 $ this ->kernel ??= FrameworkKernel::boot (
117121 root: $ this ->root ,
118122 discoveryLocations: $ discoveryLocations ,
123+ internalStorage: $ this ->internalStorage ,
119124 );
120125
121126 /** @var GenericContainer $container */
@@ -234,6 +239,8 @@ protected function tearDown(): void
234239 unset($ this ->http );
235240 /** @phpstan-ignore-next-line */
236241 unset($ this ->oauth );
242+
243+ GenericContainer::setInstance (null );
237244 }
238245
239246 protected function assertException (string $ expectedExceptionClass , Closure $ handler , ?Closure $ assertException = null , ?string $ message = null ): void
0 commit comments