You are here

public function UserAccessControlHandlerTest::adminFieldAccessProvider in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 265
Contains \Drupal\Tests\user\Unit\UserAccessControlHandlerTest.

Class

UserAccessControlHandlerTest
Tests the user access controller.

Namespace

Drupal\Tests\user\Unit

Code

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