You are here

public function RevisionUiAccessTest::updateDeleteAccessProvider in Group 8

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

Data provider for testUpdateDeleteAccess().

Return value

array A list of testUpdateDeleteAccess method arguments.

File

tests/src/Kernel/RevisionUiAccessTest.php, line 656

Class

RevisionUiAccessTest
Tests the revision UI access for groups.

Namespace

Drupal\Tests\group\Kernel

Code

public function updateDeleteAccessProvider() {
  $cases = [];
  $cases['edit-rev-default'] = [
    'entity.group.revision_revert_form',
    [
      'edit group',
    ],
    [
      'edit group',
      'revert group revisions',
    ],
    FALSE,
    FALSE,
    FALSE,
    TRUE,
    'Checking access to default revision reverting',
  ];
  $cases['edit-rev-non-default'] = [
    'entity.group.revision_revert_form',
    [
      'edit group',
    ],
    [
      'edit group',
      'revert group revisions',
    ],
    FALSE,
    TRUE,
    TRUE,
    FALSE,
    'Checking access to non-default revision reverting',
  ];
  $cases['no-edit-rev-default'] = [
    'entity.group.revision_revert_form',
    [],
    [
      'revert group revisions',
    ],
    FALSE,
    FALSE,
    FALSE,
    TRUE,
    'Checking access to default revision reverting, but the user has no update access',
  ];
  $cases['no-edit-rev-non-default'] = [
    'entity.group.revision_revert_form',
    [],
    [
      'revert group revisions',
    ],
    FALSE,
    FALSE,
    TRUE,
    FALSE,
    'Checking access to non-default revision reverting, but the user has no update access',
  ];
  $cases['delete-rev-default'] = [
    'entity.group.revision_delete_form',
    [
      'delete group',
    ],
    [
      'delete group',
      'delete group revisions',
    ],
    FALSE,
    FALSE,
    FALSE,
    TRUE,
    'Checking access to default revision deleting',
  ];
  $cases['delete-rev-non-default'] = [
    'entity.group.revision_delete_form',
    [
      'delete group',
    ],
    [
      'delete group',
      'delete group revisions',
    ],
    FALSE,
    TRUE,
    TRUE,
    FALSE,
    'Checking access to non-default revision deleting',
  ];
  $cases['no-delete-rev-default'] = [
    'entity.group.revision_delete_form',
    [],
    [
      'delete group revisions',
    ],
    FALSE,
    FALSE,
    FALSE,
    TRUE,
    'Checking access to default revision deleting, but the user has no delete access',
  ];
  $cases['no-delete-rev-non-default'] = [
    'entity.group.revision_delete_form',
    [],
    [
      'delete group revisions',
    ],
    FALSE,
    FALSE,
    TRUE,
    FALSE,
    'Checking access to non-default revision deleting, but the user has no delete access',
  ];
  return $cases;
}