You are here

protected function FieldPermissionsUserTest::checkUserFieldEdit 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::checkUserFieldEdit()

Tests field permissions on the user edit form for a given account.

Parameters

\Drupal\user\UserInterface $account: The user account to edit.

2 calls to FieldPermissionsUserTest::checkUserFieldEdit()
FieldPermissionsUserTest::checkPrivateField in tests/src/Functional/FieldPermissionsUserTest.php
Test field access with private permissions.
FieldPermissionsUserTest::testUserFieldPermissions in tests/src/Functional/FieldPermissionsUserTest.php
Test field permissions on user entities.

File

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

Class

FieldPermissionsUserTest
Test field permissions on users.

Namespace

Drupal\Tests\field_permissions\Functional

Code

protected function checkUserFieldEdit(UserInterface $account) {
  $this
    ->drupalGet($account
    ->toUrl('edit-form'));
  $this
    ->assertSession()
    ->pageTextContains('Textfield');
  $edit = [];
  $edit[$this->fieldName . '[0][value]'] = $this->fieldText;
  $this
    ->submitForm($edit, 'Save');
  $this
    ->drupalGet($account
    ->toUrl());
  $this
    ->assertSession()
    ->assertEscaped($this->fieldText);
}