You are here

protected function FieldPermissionsNodeTest::assertNodeFieldHidden 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::assertNodeFieldHidden()

Asserts that the body field is not visible.

4 calls to FieldPermissionsNodeTest::assertNodeFieldHidden()
FieldPermissionsNodeTest::checkChengeToPrivateField in tests/src/Functional/FieldPermissionsNodeTest.php
Test PUBLIC - PRIVATE EDIT - VIEW.
FieldPermissionsNodeTest::checkViewEditAllField in tests/src/Functional/FieldPermissionsNodeTest.php
Test - view edit all field.
FieldPermissionsNodeTest::checkViewEditOwnField in tests/src/Functional/FieldPermissionsNodeTest.php
Test PUBLIC - view own field.
FieldPermissionsNodeTest::checkViewOwnField in tests/src/Functional/FieldPermissionsNodeTest.php
Test PUBLIC - view own field.

File

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

Class

FieldPermissionsNodeTest
Test field permissions on nodes.

Namespace

Drupal\Tests\field_permissions\Functional

Code

protected function assertNodeFieldHidden() {
  $field_value = $this->node
    ->getFields()['body']
    ->getValue();
  $this
    ->drupalGet('node/' . $this->node
    ->id());
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextNotContains($field_value[0]['value']);
}