You are here

protected function NodeTest::assertNodeTitleMatch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/Tests/NodeTest.php \Drupal\rest\Tests\NodeTest::assertNodeTitleMatch()

Tests the title on a newly created node.

Parameters

array $data:

Return value

\Drupal\node\Entity\Node

2 calls to NodeTest::assertNodeTitleMatch()
NodeTest::testBundleNormalization in core/modules/rest/src/Tests/NodeTest.php
Test bundle normalization when posting bundle as a simple string.
NodeTest::testCreate in core/modules/rest/src/Tests/NodeTest.php
Test creating a node using json serialization.

File

core/modules/rest/src/Tests/NodeTest.php, line 68
Contains \Drupal\rest\Tests\NodeTest.

Class

NodeTest
Tests special cases for node entities.

Namespace

Drupal\rest\Tests

Code

protected function assertNodeTitleMatch($data) {

  /** @var \Drupal\node\Entity\Node $node */

  // Load the newly created node.
  $node = Node::load(1);

  // Test that the title is the same as what we posted.
  $this
    ->assertEqual($node->title->value, $data['title'][0]['value']);
  return $node;
}