You are here

public function UserAccessControlHandlerTest::adminFieldAccessProvider in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::adminFieldAccessProvider()
  2. 9 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::adminFieldAccessProvider()

Provides test data for testAdminFieldAccess().

File

core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php, line 286

Class

UserAccessControlHandlerTest
Tests the user access controller.

Namespace

Drupal\Tests\user\Unit

Code

public function adminFieldAccessProvider() {
  $access_info = [];
  $fields = [
    'roles',
    'status',
    'access',
    'login',
    'init',
  ];
  foreach ($fields as $field) {
    $access_info[] = [
      'field' => $field,
      'viewer' => 'viewer',
      'target' => 'viewer',
      'view' => FALSE,
      'edit' => FALSE,
    ];
    $access_info[] = [
      'field' => $field,
      'viewer' => 'viewer',
      'target' => 'owner',
      'view' => FALSE,
      'edit' => FALSE,
    ];
    $access_info[] = [
      'field' => $field,
      'viewer' => 'admin',
      'target' => 'owner',
      'view' => TRUE,
      'edit' => TRUE,
    ];
  }
  return $access_info;
}