Bugfixes/tasks list

This commit is contained in:
2021-11-05 12:31:41 +00:00
parent e1677cd2b6
commit 35d807cab0
11 changed files with 74 additions and 26 deletions

View File

@@ -33,12 +33,14 @@ class ParentRoleHelper
* Return all the role which give access to the given role. Only the role
* which are registered into Chill are taken into account.
*
* The array contains always the current $role (which give access to himself)
*
* @param string $role
* @return string[] the role which give access to the given $role
*/
public function getParentRoles(string $role): array
{
$parentRoles = [];
$parentRoles = [$role];
// transform the roles from role hierarchy from string to Role
$roles = \array_keys($this->hierarchy);

View File

@@ -14,7 +14,7 @@ class FilterOrderHelper
private ?array $searchBoxFields = null;
private array $checkboxes = [];
private ?array $submitted = null;
private ?string $formName = 'filter';
private ?string $formName = 'f';
private string $formType = FilterOrderType::class;
private array $formOptions = [];

View File

@@ -23,9 +23,10 @@ class ParentRoleHelperTest extends KernelTestCase
$parentRoles = $this->parentRoleHelper->getParentRoles(PersonVoter::SEE);
$this->assertCount(2, $parentRoles);
$this->assertCount(3, $parentRoles);
$this->assertContains(PersonVoter::CREATE, $parentRoles);
$this->assertContains(PersonVoter::UPDATE, $parentRoles);
$this->assertContains(PersonVoter::SEE, $parentRoles);
}
public function testIsRoleReached()