You are here

public function GroupContentCreateAccessTest::pageAccessProvider in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/GroupContentCreateAccessTest.php \Drupal\Tests\group\Kernel\GroupContentCreateAccessTest::pageAccessProvider()

Data provider for testPageAccess().

Return value

array A list of testPageAccess method arguments.

File

tests/src/Kernel/GroupContentCreateAccessTest.php, line 118

Class

GroupContentCreateAccessTest
Tests the group content create access for groups.

Namespace

Drupal\Tests\group\Kernel

Code

public function pageAccessProvider() {
  $cases = [];
  $cases['create-page-access-one'] = [
    'entity.group_content.create_page',
    [],
    [
      'create entity_test_as_content entity',
    ],
    FALSE,
    TRUE,
    TRUE,
    'Testing the _group_content_create_any_entity_access route access check with create access from one plugin',
  ];
  $cases['create-page-access-multi'] = [
    'entity.group_content.create_page',
    [],
    [
      'create entity_test_as_content entity',
      'create node_as_content:page entity',
    ],
    FALSE,
    TRUE,
    TRUE,
    'Testing the _group_content_create_any_entity_access route access check with create access from multiple plugins',
  ];
  $cases['create-page-with-add-access'] = [
    'entity.group_content.create_page',
    [],
    [
      'create entity_test_as_content content',
    ],
    FALSE,
    FALSE,
    TRUE,
    'Testing the _group_content_create_any_entity_access route access check with add access from one plugin',
  ];
  $cases['add-page-access-one'] = [
    'entity.group_content.add_page',
    [],
    [
      'create entity_test_as_content content',
    ],
    FALSE,
    TRUE,
    TRUE,
    'Testing the _group_content_create_any_access route access check with add access from one plugin',
  ];
  $cases['add-page-access-multi'] = [
    'entity.group_content.add_page',
    [],
    [
      'create entity_test_as_content content',
      'create node_as_content:page content',
    ],
    FALSE,
    TRUE,
    TRUE,
    'Testing the _group_content_create_any_access route access check with add access from multiple plugins',
  ];
  $cases['add-page-with-create-access'] = [
    'entity.group_content.add_page',
    [],
    [
      'create entity_test_as_content entity',
    ],
    FALSE,
    FALSE,
    TRUE,
    'Testing the _group_content_create_any_access route access check with create access from one plugin',
  ];
  return $cases;
}