From 713a1b4afc3da8e04d997e316f375246fe643c92 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 26 Oct 2022 09:33:44 +0200 Subject: [PATCH] Add tenantSchemaPath method --- tests/CommandsTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index 9a9f0bc5..26f039f1 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -54,6 +54,11 @@ afterEach(function () { } }); +function tenantSchemaPath(): string +{ + return database_path('schema/tenant-schema.dump'); +} + test('migrate command doesnt change the db connection', function () { expect(Schema::hasTable('users'))->toBeFalse(); @@ -121,7 +126,7 @@ test('dump command works', function () { }); test('tenant dump file gets created as tenant-schema.dump in the database schema folder by default', function() { - config(['tenancy.migration_parameters.--schema-path' => $schemaPath = database_path('schema/tenant-schema.dump')]); + config(['tenancy.migration_parameters.--schema-path' => $schemaPath = tenantSchemaPath()]); $tenant = Tenant::create(); Artisan::call('tenants:migrate');