You are here

public function GroupContentPermissionProviderTest::getPermissionProvider in Group 8

Data provider for testGetPermission().

Return value

array A list of testGetPermission method arguments.

File

tests/src/Unit/GroupContentPermissionProviderTest.php, line 543

Class

GroupContentPermissionProviderTest
Tests the default GroupContentEnabler permission_provider handler.

Namespace

Drupal\Tests\group\Unit

Code

public function getPermissionProvider() {
  $cases = [];
  foreach ($this
    ->getPermissionProviderScenarios() as $scenario) {
    foreach ([
      'view',
      'view unpublished',
      'update',
      'delete',
      'create',
    ] as $operation) {
      foreach ([
        'relation',
        'entity',
      ] as $target) {
        foreach ([
          'any',
          'own',
        ] as $scope) {
          $case = $scenario;
          $case['operation'] = $operation;
          $case['target'] = $target;
          $case['scope'] = $scope;
          unset($case['expected']);
          $cases[] = $case;
        }
      }
    }
  }
  return $cases;
}