From a0a164ffe719965d0a1b7c9f2a0735743deb931e Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 23 Jul 2025 13:18:22 +0200 Subject: [PATCH] Manually register the bootstrapper as singleton Without this, the bootstrapper doesn't respect the config. Even after setting the config to 'central', `null` (Laravel default) would be retrieved in the bootstrapper using `$this->config->get(...)` --- tests/TestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 47af9e7d..90dcf22b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -24,6 +24,7 @@ use Stancl\Tenancy\Bootstrappers\BroadcastingConfigBootstrapper; use Stancl\Tenancy\Bootstrappers\BroadcastChannelPrefixBootstrapper; use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper; use function Stancl\Tenancy\Tests\pest; +use Stancl\Tenancy\Bootstrappers\DatabaseCacheBootstrapper; abstract class TestCase extends \Orchestra\Testbench\TestCase { @@ -180,6 +181,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase // to manually register bootstrappers as singletons here. $app->singleton(RedisTenancyBootstrapper::class); $app->singleton(CacheTenancyBootstrapper::class); + $app->singleton(DatabaseCacheBootstrapper::class); $app->singleton(BroadcastingConfigBootstrapper::class); $app->singleton(BroadcastChannelPrefixBootstrapper::class); $app->singleton(PostgresRLSBootstrapper::class);