You are here

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

Verifies that the current logged in user cannot edit the user field.

Parameters

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

2 calls to FieldPermissionsUserTest::assertUserEditFieldNoAccess()
FieldPermissionsUserTest::checkPrivateField in tests/src/Functional/FieldPermissionsUserTest.php
Test field access with private permissions.
FieldPermissionsUserTest::checkUserViewEditOwnField in tests/src/Functional/FieldPermissionsUserTest.php
Test PUBLIC - view_own and edit_own field.

File

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

Class

FieldPermissionsUserTest
Test field permissions on users.

Namespace

Drupal\Tests\field_permissions\Functional

Code

protected function assertUserEditFieldNoAccess(UserInterface $account) {
  $this
    ->drupalGet($account
    ->toUrl('edit-form'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextNotContains('Textfield');
}