mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
add fixtures to test duplicate person
This commit is contained in:
parent
0d9f3d7dba
commit
0a17011cc3
@ -289,8 +289,8 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con
|
|||||||
'center' => 'centerA',
|
'center' => 'centerA',
|
||||||
'maritalStatus' => 'ms_divorce'
|
'maritalStatus' => 'ms_divorce'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
//to have a person with same firstname as Gérard Depardieu
|
//to have a person with same firstname as Gérard Depardieu
|
||||||
'LastName' => "Depardieu",
|
'LastName' => "Depardieu",
|
||||||
'FirstName' => "Jean",
|
'FirstName' => "Jean",
|
||||||
'Birthdate' => "1960-10-12",
|
'Birthdate' => "1960-10-12",
|
||||||
@ -299,28 +299,48 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con
|
|||||||
'center' => 'centerA',
|
'center' => 'centerA',
|
||||||
'maritalStatus' => 'ms_divorce'
|
'maritalStatus' => 'ms_divorce'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
//to have a person with same birthdate of Gérard Depardieu
|
//to have a person with same birthdate of Gérard Depardieu
|
||||||
'LastName' => 'Van Snick',
|
'LastName' => 'Van Snick',
|
||||||
'FirstName' => 'Bart',
|
'FirstName' => 'Bart',
|
||||||
'Birthdate' => '1948-12-27',
|
'Birthdate' => '1948-12-27',
|
||||||
'center' => 'centerA',
|
'center' => 'centerA',
|
||||||
'maritalStatus' => 'ms_legalco'
|
'maritalStatus' => 'ms_legalco'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
//to have a woman with Depardieu as FirstName
|
//to have a woman with Depardieu as FirstName
|
||||||
'LastName' => 'Depardieu',
|
'LastName' => 'Depardieu',
|
||||||
'FirstName' => 'Charline',
|
'FirstName' => 'Charline',
|
||||||
'Gender' => Person::FEMALE_GENDER,
|
'Gender' => Person::FEMALE_GENDER,
|
||||||
'center' => 'centerA',
|
'center' => 'centerA',
|
||||||
'maritalStatus' => 'ms_legalco'
|
'maritalStatus' => 'ms_legalco'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
//to have a special character in lastName
|
//to have a special character in lastName
|
||||||
'LastName' => 'Manço',
|
'LastName' => 'Manço',
|
||||||
'FirstName' => 'Étienne',
|
'FirstName' => 'Étienne',
|
||||||
'center' => 'centerA',
|
'center' => 'centerA',
|
||||||
'maritalStatus' => 'ms_unknown'
|
'maritalStatus' => 'ms_unknown'
|
||||||
)
|
),
|
||||||
|
array(
|
||||||
|
//to have true duplicate person
|
||||||
|
'LastName' => "Depardieu",
|
||||||
|
'FirstName' => "Jean",
|
||||||
|
'Birthdate' => "1960-10-12",
|
||||||
|
'CountryOfBirth' => 'FR',
|
||||||
|
'Nationality' => 'FR',
|
||||||
|
'center' => 'centerA',
|
||||||
|
'maritalStatus' => 'ms_divorce'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
//to have false duplicate person
|
||||||
|
'LastName' => "Depardieu",
|
||||||
|
'FirstName' => "Jeanne",
|
||||||
|
'Birthdate' => "1966-11-13",
|
||||||
|
'CountryOfBirth' => 'FR',
|
||||||
|
'Nationality' => 'FR',
|
||||||
|
'center' => 'centerA',
|
||||||
|
'maritalStatus' => 'ms_legalco'
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -50,24 +50,36 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
case 'social':
|
case 'social':
|
||||||
case 'direction':
|
case 'direction':
|
||||||
printf("Adding CHILL_PERSON_UPDATE & CHILL_PERSON_CREATE to %s permission group \n", $permissionsGroup->getName());
|
printf("Adding CHILL_PERSON_UPDATE & CHILL_PERSON_CREATE to %s permission group \n", $permissionsGroup->getName());
|
||||||
|
|
||||||
$roleScopeUpdate = (new RoleScope())
|
$roleScopeUpdate = (new RoleScope())
|
||||||
->setRole('CHILL_PERSON_UPDATE')
|
->setRole('CHILL_PERSON_UPDATE')
|
||||||
->setScope(null);
|
->setScope(null);
|
||||||
$permissionsGroup->addRoleScope($roleScopeUpdate);
|
$permissionsGroup->addRoleScope($roleScopeUpdate);
|
||||||
|
|
||||||
$roleScopeCreate = (new RoleScope())
|
$roleScopeCreate = (new RoleScope())
|
||||||
->setRole('CHILL_PERSON_CREATE')
|
->setRole('CHILL_PERSON_CREATE')
|
||||||
->setScope(null);
|
->setScope(null);
|
||||||
$permissionsGroup->addRoleScope($roleScopeCreate);
|
$permissionsGroup->addRoleScope($roleScopeCreate);
|
||||||
|
|
||||||
|
$roleScopeDuplicate = (new RoleScope())
|
||||||
|
->setRole('CHILL_PERSON_DUPLICATE')
|
||||||
|
->setScope(null);
|
||||||
|
$permissionsGroup->addRoleScope($roleScopeDuplicate);
|
||||||
|
|
||||||
$roleScopeList = (new RoleScope())
|
$roleScopeList = (new RoleScope())
|
||||||
->setRole(PersonVoter::LISTS)
|
->setRole(PersonVoter::LISTS)
|
||||||
->setScope(null);
|
->setScope(null);
|
||||||
$permissionsGroup->addRoleScope($roleScopeList);
|
$permissionsGroup->addRoleScope($roleScopeList);
|
||||||
|
|
||||||
$roleScopeStats = (new RoleScope())
|
$roleScopeStats = (new RoleScope())
|
||||||
->setRole(PersonVoter::STATS)
|
->setRole(PersonVoter::STATS)
|
||||||
->setScope(null);
|
->setScope(null);
|
||||||
$permissionsGroup->addRoleScope($roleScopeStats);
|
$permissionsGroup->addRoleScope($roleScopeStats);
|
||||||
|
|
||||||
$manager->persist($roleScopeUpdate);
|
$manager->persist($roleScopeUpdate);
|
||||||
$manager->persist($roleScopeCreate);
|
$manager->persist($roleScopeCreate);
|
||||||
|
$manager->persist($roleScopeDuplicate);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'administrative':
|
case 'administrative':
|
||||||
printf("Adding CHILL_PERSON_SEE to %s permission group \n", $permissionsGroup->getName());
|
printf("Adding CHILL_PERSON_SEE to %s permission group \n", $permissionsGroup->getName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user