1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 14:34:04 +00:00

Add conditional loading for Laravel version 8 and up

The schema dump functionality is not available in laravel version 7 or older
This commit is contained in:
Victor R 2022-02-15 01:38:32 -05:00
parent b0dfe338c7
commit 838a257fb3
2 changed files with 14 additions and 2 deletions

View file

@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use Stancl\JobPipeline\JobPipeline;
use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper;
use Stancl\Tenancy\Events\TenancyEnded;
@ -94,6 +95,10 @@ class CommandsTest extends TestCase
/** @test */
public function migrate_command_loads_schema_state()
{
if ((int) Str::before($this->app->version(), '.') < 8) {
$this->markTestSkipped("'Laravel version doesn't support schema dumps.'");
}
$tenant = Tenant::create();
$this->assertFalse(Schema::hasTable('schema_users'));
@ -114,6 +119,10 @@ class CommandsTest extends TestCase
/** @test */
public function dump_command_works()
{
if ((int) Str::before($this->app->version(), '.') < 9) {
$this->markTestSkipped("'Laravel version doesn't support schema dumps.'");
}
$tenant = Tenant::create();
Artisan::call('tenants:migrate');