You are here

protected function FieldPermissionsNodeTest::checkFieldPermissionConfigurationEdit in Field Permissions 8

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

Test field permission configuration access.

1 call to FieldPermissionsNodeTest::checkFieldPermissionConfigurationEdit()
FieldPermissionsNodeTest::testNodeFieldPermissions in tests/src/Functional/FieldPermissionsNodeTest.php
Test field permissions on nodes.

File

tests/src/Functional/FieldPermissionsNodeTest.php, line 135

Class

FieldPermissionsNodeTest
Test field permissions on nodes.

Namespace

Drupal\Tests\field_permissions\Functional

Code

protected function checkFieldPermissionConfigurationEdit() {
  $this
    ->drupalLogin($this->webUser);

  // Test page without admin field permission.
  $this
    ->drupalGet('admin/structure/types/manage/article/fields/node.article.body');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextNotContains('Field visibility and permissions');
  $this->webUserRole
    ->grantPermission('administer field permissions')
    ->save();

  // Test page with admin field permission.
  $this
    ->drupalGet('admin/structure/types/manage/article/fields/node.article.body');
  $this
    ->assertSession()
    ->pageTextContains('Field visibility and permissions');
  $this
    ->drupalLogout();
}