1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:44:02 +00:00

Unlink tenant schema path before each test in CommandsTest (#986)

* Add tenantSchemaPath method

* Unlink tenant schema path before each test in CommandsTest

* Remove the tenantSchemaPath helper
This commit is contained in:
lukinovec 2022-10-26 12:08:14 +02:00 committed by GitHub
parent 9a8e95c9f6
commit 15dc40839b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,10 @@ use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper;
beforeEach(function () {
if (file_exists($schemaPath = database_path('schema/tenant-schema.dump'))) {
unlink($schemaPath);
}
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
return $event->tenant;
})->toListener());
@ -131,7 +135,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 () {