protected function NodeTest::assertNodeTitleMatch in Zircon Profile 8
Same name and namespace in other branches
- 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
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\TestsCode
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;
}