protected function FieldPermissionsNodeTest::checkViewOwnField in Field Permissions 8
Same name and namespace in other branches
- 8.2 tests/src/Functional/FieldPermissionsNodeTest.php \Drupal\Tests\field_permissions\Functional\FieldPermissionsNodeTest::checkViewOwnField()
Test PUBLIC - view own field.
1 call to FieldPermissionsNodeTest::checkViewOwnField()
- FieldPermissionsNodeTest::testNodeFieldPermissions in tests/
src/ Functional/ FieldPermissionsNodeTest.php - Test field permissions on nodes.
File
- tests/
src/ Functional/ FieldPermissionsNodeTest.php, line 189
Class
- FieldPermissionsNodeTest
- Test field permissions on nodes.
Namespace
Drupal\Tests\field_permissions\FunctionalCode
protected function checkViewOwnField() {
$permission = [];
$permission = $this
->grantCustomPermissions($this->limitUserRole, [
'view own body',
], $permission);
$this
->setNodeFieldPermissions(FieldPermissionTypeInterface::ACCESS_CUSTOM, $permission);
// Login width author node.
$this
->drupalLogin($this->limitedUser);
$this
->assertNodeFieldVisible();
$this
->assertNodeFieldEditNoAccess();
$this
->drupalLogout();
// Login webuser.
$this
->drupalLogin($this->webUser);
$this
->assertNodeFieldHidden();
$this
->assertNodeFieldEditNoAccess();
$this
->drupalLogout();
}