From 80a58002dea2f322d4a8f3474cfb0568cb03b788 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 17 Feb 2023 15:07:23 +0100 Subject: [PATCH] Make UrlTenancyBootstrapper a singleton --- tests/TestCase.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 07af199f..f6589688 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,17 +4,17 @@ declare(strict_types=1); namespace Stancl\Tenancy\Tests; -use Dotenv\Dotenv; -use Illuminate\Foundation\Application; -use Illuminate\Support\Facades\Redis; use PDO; -use Stancl\Tenancy\Bootstrappers\BatchTenancyBootstrapper; -use Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper; -use Stancl\Tenancy\Facades\GlobalCache; +use Dotenv\Dotenv; use Stancl\Tenancy\Facades\Tenancy; -use Stancl\Tenancy\TenancyServiceProvider; use Stancl\Tenancy\Tests\Etc\Tenant; +use Illuminate\Support\Facades\Redis; +use Illuminate\Foundation\Application; +use Stancl\Tenancy\Facades\GlobalCache; +use Stancl\Tenancy\TenancyServiceProvider; +use Stancl\Tenancy\Bootstrappers\UrlTenancyBootstrapper; use Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper; +use Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper; abstract class TestCase extends \Orchestra\Testbench\TestCase { @@ -106,6 +106,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase ], 'tenancy.bootstrappers.redis' => RedisTenancyBootstrapper::class, // todo1 change this to []? two tests in TenantDatabaseManagerTest are failing with that 'tenancy.bootstrappers.mail' => MailTenancyBootstrapper::class, + 'tenancy.bootstrappers.url' => UrlTenancyBootstrapper::class, 'queue.connections.central' => [ 'driver' => 'sync', 'central' => true, @@ -116,6 +117,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase $app->singleton(RedisTenancyBootstrapper::class); // todo (Samuel) use proper approach eg config for singleton registration $app->singleton(MailTenancyBootstrapper::class); + $app->singleton(UrlTenancyBootstrapper::class); } protected function getPackageProviders($app)