From 2d2d3b88b0ee7db453a54832c783d35305a245a4 Mon Sep 17 00:00:00 2001 From: Abrar Ahmad Date: Mon, 22 Aug 2022 13:53:44 +0500 Subject: [PATCH] Revert "register dumcommand when L8" This reverts commit f165fc58ba9b62b76798fdf0f9330319bceb7afd. --- src/TenancyServiceProvider.php | 8 +------- tests/CommandsTest.php | 14 -------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/TenancyServiceProvider.php b/src/TenancyServiceProvider.php index e6465b00..e23200a6 100644 --- a/src/TenancyServiceProvider.php +++ b/src/TenancyServiceProvider.php @@ -84,16 +84,10 @@ class TenancyServiceProvider extends ServiceProvider Commands\Migrate::class, Commands\Rollback::class, Commands\TenantList::class, + Commands\TenantDump::class, Commands\MigrateFresh::class, ]); - if (version_compare(app()->version(), '8.0', '>=')) { - // DumpCommand only exists since Laravel 8.0 or above - $this->commands([ - Commands\TenantDump::class, - ]); - } - $this->publishes([ __DIR__ . '/../assets/config.php' => config_path('tenancy.php'), ], 'config'); diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index de7d4303..5172d752 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -76,11 +76,6 @@ test('migrate command works with tenants option', function () { }); test('migrate command loads schema state', function () { - if (! isVersion8()) { - $this->markTestSkipped('DumpCommand only exists since Laravel 8.0 or above'); - } - - $tenant = Tenant::create(); expect(Schema::hasTable('schema_users'))->toBeFalse(); @@ -99,10 +94,6 @@ test('migrate command loads schema state', function () { }); test('dump command works', function () { - if (! isVersion8()) { - $this->markTestSkipped('DumpCommand only exists since Laravel 8.0 or above'); - } - $tenant = Tenant::create(); Artisan::call('tenants:migrate'); @@ -219,8 +210,3 @@ function databaseConnectionSwitchedToDefault() expect(DB::connection()->getDatabaseName())->toBe($originalDBName); } - -function isVersion8(): bool -{ - return version_compare(app()->version(), '8.0', '>='); -}