public function UserAccessControlHandlerTest::hiddenUserSettingsProvider in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::hiddenUserSettingsProvider()
Provides test data for testHiddenUserSettings().
File
- core/
modules/ user/ tests/ src/ Unit/ UserAccessControlHandlerTest.php, line 206 - Contains \Drupal\Tests\user\Unit\UserAccessControlHandlerTest.
Class
- UserAccessControlHandlerTest
- Tests the user access controller.
Namespace
Drupal\Tests\user\UnitCode
public function hiddenUserSettingsProvider() {
$access_info = array();
$fields = array(
'preferred_langcode',
'preferred_admin_langcode',
'timezone',
'mail',
);
foreach ($fields as $field) {
$access_info[] = array(
'field' => $field,
'viewer' => 'viewer',
'target' => 'viewer',
'view' => TRUE,
'edit' => TRUE,
);
$access_info[] = array(
'field' => $field,
'viewer' => 'viewer',
'target' => 'owner',
'view' => FALSE,
// Anyone with edit access to the user can also edit these fields. In
// reality edit access will already be checked on entity level and the
// user without view access will typically not be able to edit.
'edit' => TRUE,
);
$access_info[] = array(
'field' => $field,
'viewer' => 'owner',
'target' => 'owner',
'view' => TRUE,
'edit' => TRUE,
);
$access_info[] = array(
'field' => $field,
'viewer' => 'admin',
'target' => 'owner',
'view' => TRUE,
'edit' => TRUE,
);
}
return $access_info;
}