3737use Tempest \Storage \Testing \StorageTester ;
3838use Throwable ;
3939
40+ use function Tempest \env ;
4041use function Tempest \Support \Path \normalize ;
4142use function Tempest \Support \Path \to_absolute_path ;
4243
@@ -47,6 +48,8 @@ abstract class IntegrationTest extends TestCase
4748{
4849 protected string $ root ;
4950
51+ protected string $ internalStorage ;
52+
5053 /** @var \Tempest\Discovery\DiscoveryLocation[] */
5154 protected array $ discoveryLocations = [];
5255
@@ -111,12 +114,14 @@ protected function setupKernel(): self
111114 {
112115 // We force forward slashes for consistency even on Windows.
113116 $ this ->root ??= normalize (realpath (getcwd ()));
117+ $ this ->internalStorage = $ this ->root . '/.tempest/test_internal_storage/ ' . env ('TEST_TOKEN ' , 'default ' );
114118
115119 $ discoveryLocations = [...$ this ->discoveryLocations , ...$ this ->discoverTestLocations ()];
116120
117121 $ this ->kernel ??= FrameworkKernel::boot (
118122 root: $ this ->root ,
119123 discoveryLocations: $ discoveryLocations ,
124+ internalStorage: $ this ->internalStorage ,
120125 );
121126
122127 /** @var GenericContainer $container */
@@ -235,6 +240,8 @@ protected function tearDown(): void
235240 unset($ this ->http );
236241 /** @phpstan-ignore-next-line */
237242 unset($ this ->oauth );
243+
244+ GenericContainer::setInstance (null );
238245 }
239246
240247 protected function assertException (string $ expectedExceptionClass , Closure $ handler , ?Closure $ assertException = null , ?string $ message = null ): void
0 commit comments