mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +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:
parent
9a8e95c9f6
commit
15dc40839b
1 changed files with 4 additions and 1 deletions
|
|
@ -26,6 +26,10 @@ use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper;
|
||||||
|
|
||||||
|
|
||||||
beforeEach(function () {
|
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) {
|
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
|
||||||
return $event->tenant;
|
return $event->tenant;
|
||||||
})->toListener());
|
})->toListener());
|
||||||
|
|
@ -131,7 +135,6 @@ test('tenant dump file gets created as tenant-schema.dump in the database schema
|
||||||
Artisan::call('tenants:dump');
|
Artisan::call('tenants:dump');
|
||||||
|
|
||||||
expect($schemaPath)->toBeFile();
|
expect($schemaPath)->toBeFile();
|
||||||
unlink($schemaPath);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('migrate command uses the correct schema path by default', function () {
|
test('migrate command uses the correct schema path by default', function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue