public function UserAccessControlHandlerTest::adminFieldAccessProvider in Drupal 8
Same name and namespace in other branches
- 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 260
Class
- UserAccessControlHandlerTest
- Tests the user access controller.
Namespace
Drupal\Tests\user\UnitCode
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;
}