Added some unit tests.

This commit is contained in:
Jan Böhmer 2019-03-26 23:34:40 +01:00
parent 1c7155d4e7
commit 943d235b8b
9 changed files with 562 additions and 40 deletions

View file

@ -179,8 +179,12 @@ class PermissionResolver
*/
public function listOperationsForPermission(string $permission): array
{
if(!$this->isValidPermission($permission)) {
throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission));
}
$operations = $this->permission_structure['perms'][$permission]['operations'];
return array_keys($operations);
}