You are here

public function GroupContentPermissionProviderTest::entityViewUnpublishedPermissionProvider in Group 8

Data provider for testGetEntityViewUnpublishedPermission().

Return value

array A list of testGetEntityViewUnpublishedPermission method arguments.

File

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

Class

GroupContentPermissionProviderTest
Tests the default GroupContentEnabler permission_provider handler.

Namespace

Drupal\Tests\group\Unit

Code

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

        // View own unpublished entity is not implemented yet.
        if ($scope === 'any') {
          $case['expected'] = "view {$scope} unpublished {$scenario['plugin_id']} entity";
        }
      }
      $cases[] = $case;
    }
  }
  return $cases;
}