From a64ad69112e9c6a3ce296b17fefde9b5addf1681 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 23 Nov 2022 13:05:28 +0100 Subject: [PATCH] Test generating tenant dump at the configured path --- tests/CommandsTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index 355fb429..d8484253 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -134,6 +134,20 @@ test('dump command generates dump at the passed path', function() { expect($schemaPath)->toBeFile(); }); +test('dump command generates dump at the path specified in the tenancy migration parameters config', function() { + config(['tenancy.migration_parameters.--schema-path' => $schemaPath = 'tests/Etc/tenant-schema-test.dump']); + + $tenant = Tenant::create(); + + Artisan::call('tenants:migrate'); + + expect($schemaPath)->not()->toBeFile(); + + Artisan::call("tenants:dump --tenant='$tenant->id'"); + + expect($schemaPath)->toBeFile(); +}); + test('migrate command correctly uses the schema dump located at the configured schema path by default', function () { config(['tenancy.migration_parameters.--schema-path' => 'tests/Etc/tenant-schema.dump']); $tenant = Tenant::create();