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

fixed messed up names

This commit is contained in:
Abrar Ahmad 2022-06-29 18:48:51 +05:00
parent 0692cdc36a
commit e7d0bbf302
5 changed files with 7 additions and 10 deletions

View file

@ -2,8 +2,6 @@
declare(strict_types=1);
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Schema;
use Stancl\JobPipeline\JobPipeline;

View file

@ -49,7 +49,7 @@ beforeEach(function () {
UpdateSyncedResource::$shouldQueue = false; // global state cleanup
Event::listen(SyncedResourceSaved::class, UpdateSyncedResource::class);
$this->artisan('migrate', [
test()->artisan('migrate', [
'--path' => [
__DIR__ . '/Etc/synced_resource_migrations',
__DIR__ . '/Etc/synced_resource_migrations/users',
@ -225,7 +225,7 @@ test('attaching a tenant to the central resource triggers a pull from the tenant
});
});
test('attaching users to tenants d o e s n o t d o a n y t h i n g', function () {
test('attaching users to tenants does not do anything', function () {
$centralUser = CentralUser::create([
'global_id' => 'acme',
'name' => 'John Doe',
@ -294,7 +294,7 @@ test('resources are synced only to workspaces that have the resource', function
});
});
test('when a resource exists in other tenant dbs but is c r e a t e d in a tenant db the synced columns are updated in the other dbs', function () {
test('when a resource exists in other tenant dbs but is created in a tenant db the synced columns are updated in the other dbs', function () {
// create shared resource
$centralUser = CentralUser::create([
'global_id' => 'acme',
@ -570,6 +570,7 @@ function migrateTenantsResource()
'--realpath' => true,
])->assertExitCode(0);
}
class ResourceTenant extends Tenant
{
public function users()

View file

@ -158,7 +158,7 @@ test('secondary models are scoped to the current tenant when accessed via primar
expect(Post::first()->comments->count())->toBe(1);
});
test('secondary models are n o t scoped to the current tenant when accessed directly', function () {
test('secondary models are not scoped to the current tenant when accessed directly', function () {
// $this->secondary_models_are_scoped_to_the_current_tenant_when_accessed_via_primary_model();
// acme context
tenancy()->initialize($acme = Tenant::create([
@ -189,7 +189,7 @@ test('secondary models are n o t scoped to the current tenant when accessed dire
expect(Comment::count())->toBe(2);
});
test('secondary models a r e scoped to the current tenant when accessed directly a n d p a r e n t r e l a t i o n s h i p t r a i t i s u s e d', function () {
test('secondary models a r e scoped to the current tenant when accessed directly and parent relationship traitis used', function () {
$acme = Tenant::create([
'id' => 'acme',
]);
@ -221,7 +221,7 @@ test('secondary models a r e scoped to the current tenant when accessed directly
expect(ScopedComment::count())->toBe(2);
});
test('secondary models are n o t scoped in the central context', function () {
test('secondary models are not scoped in the central context', function () {
// $this->secondary_models_are_scoped_to_the_current_tenant_when_accessed_via_primary_model();
// acme context
tenancy()->initialize($acme = Tenant::create([

View file

@ -96,7 +96,6 @@ test('asset helper tenancy can be disabled', function () {
expect(asset('foo'))->toBe($original);
});
// Helpers
function getEnvironmentSetUp($app)
{
// parent::getEnvironmentSetUp($app);

View file

@ -225,7 +225,6 @@ test('impersonation works with multiple models and guards', function () {
});
});
// Helpers
function migrateTenants()
{
test()->artisan('tenants:migrate')->assertExitCode(0);