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

Update ResourceSyncingTest.php

This commit is contained in:
MinaseTaki 2020-07-27 13:27:15 +03:00 committed by GitHub
parent f2a3cf028c
commit aec73f28b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -573,6 +573,29 @@ class ResourceSyncingTest extends TestCase
return $event->tenant === null; return $event->tenant === null;
}); });
} }
/** @test */
public function create_central_user_from_tenant_context()
{
$tenant = ResourceTenant::create();
$this->migrateTenants();
tenancy()->initialize($tenant);
// Create user in central DB
$user = CentralUser::create([
'global_id' => 'test2',
'name' => 'Test John Doe',
'email' => 'testjohn@localhost',
'password' => 'secret',
'role' => 'superadmin', // unsynced
]);
//$this->assertCount(1, $tenant->users()->get());
$this->assertCount(1, ResourceUser::all());
tenancy()->end();
}
} }
class ResourceTenant extends Tenant class ResourceTenant extends Tenant