You are here

protected function PermissionEventTest::getPermissionProperties in Organic groups 8

Returns the property names that are used for the given Permission object.

Parameters

\Drupal\og\PermissionInterface $permission: The Permission object for which to return the properties.

Return value

array An array of property names.

1 call to PermissionEventTest::getPermissionProperties()
PermissionEventTest::assertPermission in tests/src/Kernel/PermissionEventTest.php
Asserts that the two permissions are identical.

File

tests/src/Kernel/PermissionEventTest.php, line 241

Class

PermissionEventTest
Tests the implementations of the PermissionEvent in 'og' and 'og_ui'.

Namespace

Drupal\Tests\og\Kernel

Code

protected function getPermissionProperties(PermissionInterface $permission) {
  $shared_permissions = [
    'default roles',
    'description',
    'name',
    'restrict access',
    'title',
  ];
  if ($permission instanceof GroupPermission) {
    return array_merge($shared_permissions, [
      'roles',
    ]);
  }
  return array_merge($shared_permissions, [
    'entity type',
    'bundle',
    'operation',
    'owner',
  ]);
}