You are here

protected function GroupContentAccessControlHandlerTest::getAccessControlHandlerScenarios in Group 8

All possible scenarios for an access control handler.

Return value

array A set of test cases to be used in data providers.

4 calls to GroupContentAccessControlHandlerTest::getAccessControlHandlerScenarios()
GroupContentAccessControlHandlerTest::entityAccessProvider in tests/src/Unit/GroupContentAccessControlHandlerTest.php
Data provider for testEntityAccess().
GroupContentAccessControlHandlerTest::entityCreateAccessProvider in tests/src/Unit/GroupContentAccessControlHandlerTest.php
Data provider for entityCreateAccessProvider.
GroupContentAccessControlHandlerTest::relationAccessProvider in tests/src/Unit/GroupContentAccessControlHandlerTest.php
Data provider for testRelationAccess().
GroupContentAccessControlHandlerTest::relationCreateAccessProvider in tests/src/Unit/GroupContentAccessControlHandlerTest.php
Data provider for testRelationCreateAccess.

File

tests/src/Unit/GroupContentAccessControlHandlerTest.php, line 616

Class

GroupContentAccessControlHandlerTest
Tests the default GroupContentEnabler access handler.

Namespace

Drupal\Tests\group\Unit

Code

protected function getAccessControlHandlerScenarios() {
  $scenarios = [];
  foreach ([
    'administer foo',
    FALSE,
  ] as $admin_permission) {
    foreach ([
      TRUE,
      FALSE,
    ] as $has_admin_permission) {
      foreach ([
        TRUE,
        FALSE,
      ] as $has_permission) {
        $scenarios[] = [
          'expected' => NULL,
          // We use a derivative ID to prove these work.
          'plugin_id' => 'foo:baz',
          'definition' => [
            'id' => 'foo',
            'label' => 'Foo',
            'entity_type_id' => 'bar',
            'admin_permission' => $admin_permission,
          ],
          'has_admin_permission' => $has_admin_permission,
          'has_permission' => $has_permission,
        ];
      }
    }
  }
  return $scenarios;
}