mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 21:54:02 +00:00
complete test sqlite manager customize path
This commit is contained in:
parent
abd17f83a1
commit
13fed332cd
2 changed files with 25 additions and 4 deletions
|
|
@ -225,7 +225,21 @@ test('tenant database can be created on a foreign server', function () {
|
|||
});
|
||||
|
||||
test('path used by sqlite manager can be customized', function () {
|
||||
pest()->markTestIncomplete();
|
||||
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
|
||||
return $event->tenant;
|
||||
})->toListener());
|
||||
|
||||
// Set custom path for SQLite file
|
||||
SQLiteDatabaseManager::$path = $customPath = storage_path();
|
||||
|
||||
$name = Str::random(8). '.sqlite';
|
||||
Tenant::create([
|
||||
'tenancy_db_name' => $name,
|
||||
'tenancy_db_connection' => 'sqlite',
|
||||
]);
|
||||
|
||||
expect(file_exists( $customPath . '/' . $name))->toBeTrue();
|
||||
unlink($customPath . '/' . $name); // clean up
|
||||
});
|
||||
|
||||
// Datasets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue