Skip to content

Commit e75ac38

Browse files
committed
Grab the central connection name from the config in harden test
Other tests grab the central connection from the config instead of hardcoding 'central'. Doing the same in 'harden prevents tenants from using the database of another tenant' for consistency.
1 parent c784a26 commit e75ac38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
expect(fn () => tenancy()->initialize($tenant))->toThrow(RuntimeException::class);
116116

117117
// Connection should be reverted back to central
118-
expect(DB::connection()->getName())->toBe('central');
118+
expect(DB::connection()->getName())->toBe(config('tenancy.database.central_connection'));
119119
} else {
120120
expect(fn() => tenancy()->initialize($tenant))->not()->toThrow(Throwable::class);
121121

0 commit comments

Comments
 (0)