You are here

public function GroupContentPermissionProviderTest::entityViewPermissionProvider in Group 8

Data provider for testGetEntityViewPermission().

Return value

array A list of testGetEntityViewPermission method arguments.

File

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

Class

GroupContentPermissionProviderTest
Tests the default GroupContentEnabler permission_provider handler.

Namespace

Drupal\Tests\group\Unit

Code

public function entityViewPermissionProvider() {
  $cases = [];
  foreach ($this
    ->getPermissionProviderScenarios() as $scenario) {
    foreach ([
      'any',
      'own',
    ] as $scope) {
      $case = $scenario;
      $case['scope'] = $scope;
      $case['expected'] = FALSE;
      if ($case['definition']['entity_access']) {

        // View own entity is not present in version 1.x.
        if ($scope === 'any') {
          $case['expected'] = "view {$scenario['plugin_id']} entity";
        }
      }
      $cases[] = $case;
    }
  }
  return $cases;
}