mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:54:05 +00:00
Update ResourceSyncingTest.php
This commit is contained in:
parent
6e966ce974
commit
93ed5eaa49
1 changed files with 16 additions and 7 deletions
|
|
@ -923,10 +923,12 @@ class ResourceUser extends Model implements Syncable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// override method in ResourceUser class to return default attribute values
|
||||||
class TenantUserProvidingDefaultValues extends ResourceUser
|
class TenantUserProvidingDefaultValues extends ResourceUser
|
||||||
{
|
{
|
||||||
public function getSyncedCreationAttributes(): array
|
public function getSyncedCreationAttributes(): array
|
||||||
{
|
{
|
||||||
|
// Default values when creating resources from tenant to central DB
|
||||||
return
|
return
|
||||||
[
|
[
|
||||||
'name' => 'Default Name',
|
'name' => 'Default Name',
|
||||||
|
|
@ -938,10 +940,14 @@ class TenantUserProvidingDefaultValues extends ResourceUser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// override method in ResourceUser class to return attribute names
|
||||||
class TenantUserProvidingAttributeNames extends ResourceUser
|
class TenantUserProvidingAttributeNames extends ResourceUser
|
||||||
{
|
{
|
||||||
public function getSyncedCreationAttributes(): array
|
public function getSyncedCreationAttributes(): array
|
||||||
{
|
{
|
||||||
|
// Attributes used when creating resources from tenant to central DB
|
||||||
|
// Notice here we are not adding "code" filed because it doesn't
|
||||||
|
// exist in central model
|
||||||
return
|
return
|
||||||
[
|
[
|
||||||
'name',
|
'name',
|
||||||
|
|
@ -954,10 +960,12 @@ class TenantUserProvidingAttributeNames extends ResourceUser
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TenantUserProvidingMixture extends ResourceUser
|
// override method in CentralUser class to return attribute default values
|
||||||
|
class CentralUserProvidingDefaultValues extends CentralUser
|
||||||
{
|
{
|
||||||
public function getSyncedCreationAttributes(): array
|
public function getSyncedCreationAttributes(): array
|
||||||
{
|
{
|
||||||
|
// Attributes default values when creating resources from central to tenant model
|
||||||
return
|
return
|
||||||
[
|
[
|
||||||
'name' => 'Default User',
|
'name' => 'Default User',
|
||||||
|
|
@ -968,10 +976,12 @@ class TenantUserProvidingMixture extends ResourceUser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CentralUserProvidingDefaultValues extends CentralUser
|
// override method in CentralUser class to return attribute names
|
||||||
|
class CentralUserProvidingAttributeNames extends CentralUser
|
||||||
{
|
{
|
||||||
public function getSyncedCreationAttributes(): array
|
public function getSyncedCreationAttributes(): array
|
||||||
{
|
{
|
||||||
|
// Attributes used when creating resources from central to tenant DB
|
||||||
return
|
return
|
||||||
[
|
[
|
||||||
'global_id',
|
'global_id',
|
||||||
|
|
@ -983,21 +993,20 @@ class CentralUserProvidingDefaultValues extends CentralUser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CentralUserProvidingAttributeNames extends CentralUser
|
class CentralUserProvidingMixture extends CentralUser
|
||||||
{
|
{
|
||||||
public function getSyncedCreationAttributes(): array
|
public function getSyncedCreationAttributes(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'global_id',
|
|
||||||
'name',
|
'name',
|
||||||
'password',
|
|
||||||
'email',
|
'email',
|
||||||
'role',
|
'role' => 'admin',
|
||||||
|
'password' => 'secret',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CentralUserProvidingMixture extends CentralUser
|
class TenantUserProvidingMixture extends ResourceUser
|
||||||
{
|
{
|
||||||
public function getSyncedCreationAttributes(): array
|
public function getSyncedCreationAttributes(): array
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue