You are here

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

Verify the test field is not accessible when viewing the given user.

Parameters

\Drupal\user\UserInterface $account: The account to verify field permissions for viewing.

2 calls to FieldPermissionsUserTest::assertUserFieldNoAccess()
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 130

Class

FieldPermissionsUserTest
Test field permissions on users.

Namespace

Drupal\Tests\field_permissions\Functional

Code

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