function UserAccessControlHandlerTest::adminFieldAccessProvider

Same name in other branches
  1. 9 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::adminFieldAccessProvider()
  2. 10 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::adminFieldAccessProvider()
  3. 11.x 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 260

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.