mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 21:34:03 +00:00
added // todo@tests
This commit is contained in:
parent
c515bbfaa1
commit
8f1ebde3ab
6 changed files with 6 additions and 2 deletions
|
|
@ -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' => [
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue