You are here

public function GroupContentPermissionProviderTest::relationViewPermissionProvider in Group 8

Data provider for testGetRelationViewPermission().

Return value

array A list of testGetRelationViewPermission method arguments.

File

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

Class

GroupContentPermissionProviderTest
Tests the default GroupContentEnabler permission_provider handler.

Namespace

Drupal\Tests\group\Unit

Code

public function relationViewPermissionProvider() {
  $cases = [];
  foreach ($this
    ->getPermissionProviderScenarios() as $scenario) {
    foreach ([
      'any',
      'own',
    ] as $scope) {
      $case = $scenario;
      $case['scope'] = $scope;

      // View own relation is not present in version 1.x.
      $case['expected'] = $scope === 'any' ? "view {$scenario['plugin_id']} content" : FALSE;
      $cases[] = $case;
    }
  }
  return $cases;
}