You are here

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

Create a node directly via the API.

1 call to FieldPermissionsNodeTest::addNode()
FieldPermissionsNodeTest::checkInitAddNode in tests/src/Functional/FieldPermissionsNodeTest.php
Test create content.

File

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

Class

FieldPermissionsNodeTest
Test field permissions on nodes.

Namespace

Drupal\Tests\field_permissions\Functional

Code

protected function addNode() {
  $this->node = $this
    ->drupalCreateNode([
    'type' => 'article',
    'uid' => $this->limitedUser
      ->id(),
  ]);
  $this
    ->drupalGet('node/' . $this->node
    ->id());
  $node_body = $this->node
    ->getFields()['body']
    ->getValue();
  $this
    ->assertSession()
    ->responseContains($node_body[0]['value']);
}