You are here

public function PermissionsTest::permissionsProvider in Term Merge 8

Data provider for the testPermissions test.

Return value

array The test data sets containing: permissions: string[] Contains the permissions the user should have. expectedStatusCode: int The status code that should be returned.

File

tests/src/Functional/PermissionsTest.php, line 22

Class

PermissionsTest
Tests the Term Merge module permissions.

Namespace

Drupal\Tests\term_merge\Functional

Code

public function permissionsProvider() {
  $testData = [];
  $testData['no permissions'] = [
    'permissions' => [],
    'expectedStatusCode' => 403,
  ];
  $testData['no edit permission'] = [
    'permissions' => [
      'merge taxonomy terms',
    ],
    'expectedStatusCode' => 403,
  ];
  $testData['edit permission'] = [
    'permissions' => [
      'merge taxonomy terms',
      'edit terms in %vocabulary_id',
    ],
    'expectedStatusCode' => 200,
  ];
  return $testData;
}