You are here

public function FieldPermissionsUserTest::testUserFieldPermissions in Field Permissions 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/FieldPermissionsUserTest.php \Drupal\Tests\field_permissions\Functional\FieldPermissionsUserTest::testUserFieldPermissions()

Test field permissions on user entities.

File

tests/src/Functional/FieldPermissionsUserTest.php, line 47

Class

FieldPermissionsUserTest
Test field permissions on users.

Namespace

Drupal\Tests\field_permissions\Functional

Code

public function testUserFieldPermissions() {
  $this
    ->drupalLogin($this->adminUser);

  // Compila il campo per l'utente admin.
  $this
    ->checkUserFieldEdit($this->adminUser);
  $this
    ->drupalLogout();

  // Controllo che si visibile ad altri utenti.
  $this
    ->drupalLogin($this->limitedUser);
  $this
    ->assertUserFieldAccess($this->adminUser);
  $this
    ->drupalLogout();

  // These are all run within a single test method to avoid unnecessary site
  // installs.
  $this
    ->checkPrivateField();
  $this
    ->checkUserViewEditOwnField();
  $this
    ->checkUserViewEditField();
}