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

added // todo@tests

This commit is contained in:
Abrar Ahmad 2022-07-01 12:21:41 +05:00
parent c515bbfaa1
commit 8f1ebde3ab
6 changed files with 6 additions and 2 deletions

View file

@ -89,6 +89,7 @@ test('central helper doesnt change tenancy state when called in central context'
expect(tenant())->toBeNull(); expect(tenant())->toBeNull();
}); });
// todo@tests
function contextIsSwitchedWhenTenancyInitialized() function contextIsSwitchedWhenTenancyInitialized()
{ {
config(['tenancy.bootstrappers' => [ config(['tenancy.bootstrappers' => [

View file

@ -182,7 +182,6 @@ test('filesystem data is separated', function () {
expect($new_storage_path)->toEqual($expected_storage_path); expect($new_storage_path)->toEqual($expected_storage_path);
}); });
// Helpers
function getDiskPrefix(string $disk): string function getDiskPrefix(string $disk): string
{ {
/** @var FilesystemAdapter $disk */ /** @var FilesystemAdapter $disk */

View file

@ -179,6 +179,7 @@ test('run command with array of tenants works', function () {
->expectsOutput('Tenant: ' . $tenantId2); ->expectsOutput('Tenant: ' . $tenantId2);
}); });
// todo@tests
function runCommandWorks(): void function runCommandWorks(): void
{ {
$id = Tenant::create()->getTenantKey(); $id = Tenant::create()->getTenantKey();
@ -191,6 +192,7 @@ function runCommandWorks(): void
->expectsOutput('xyz'); ->expectsOutput('xyz');
} }
// todo@tests
function databaseConnectionSwitchedToDefault() function databaseConnectionSwitchedToDefault()
{ {
$originalDBName = DB::connection()->getDatabaseName(); $originalDBName = DB::connection()->getDatabaseName();

View file

@ -502,6 +502,7 @@ test('an event is fired for all touched resources', function () {
}); });
}); });
// todo@tests
function creatingResourceInTenantDatabaseCreatesAndMapInCentralDatabase() function creatingResourceInTenantDatabaseCreatesAndMapInCentralDatabase()
{ {
// Assert no user in central DB // Assert no user in central DB

View file

@ -227,6 +227,7 @@ test('the model returned by the tenant helper has unique and exists validation r
expect($existsFails)->toBeFalse(); expect($existsFails)->toBeFalse();
}); });
// todo@tests
function primaryModelsScopedToCurrentTenant() function primaryModelsScopedToCurrentTenant()
{ {
// acme context // acme context
@ -273,6 +274,7 @@ function primaryModelsScopedToCurrentTenant()
expect(Post::count())->toBe(1); expect(Post::count())->toBe(1);
} }
// todo@tests
function secondaryModelsAreScopedToCurrentTenant() function secondaryModelsAreScopedToCurrentTenant()
{ {
// acme context // acme context

View file

@ -238,7 +238,6 @@ dataset('database_manager_provider', [
['sqlsrv', MicrosoftSQLDatabaseManager::class] ['sqlsrv', MicrosoftSQLDatabaseManager::class]
]); ]);
// Helpers
function createUsersTable() function createUsersTable()
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {