From ca38123d845e9cbf29fbb253320674bfb4d4210b Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 26 Oct 2022 09:34:20 +0200 Subject: [PATCH] Unlink tenant schema path before each test in CommandsTest --- tests/CommandsTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index 26f039f1..9303cde0 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -26,6 +26,10 @@ use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper; beforeEach(function () { + if (file_exists($schemaPath = tenantSchemaPath())) { + unlink($schemaPath); + } + Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) { return $event->tenant; })->toListener()); @@ -136,7 +140,6 @@ test('tenant dump file gets created as tenant-schema.dump in the database schema Artisan::call('tenants:dump'); expect($schemaPath)->toBeFile(); - unlink($schemaPath); }); test('migrate command uses the correct schema path by default', function () {