function NodeCacheTagsTest::createEntity
Same name in other branches
- 9 core/modules/node/tests/src/Functional/NodeCacheTagsTest.php \Drupal\Tests\node\Functional\NodeCacheTagsTest::createEntity()
- 10 core/modules/node/tests/src/Functional/NodeCacheTagsTest.php \Drupal\Tests\node\Functional\NodeCacheTagsTest::createEntity()
- 11.x core/modules/node/tests/src/Functional/NodeCacheTagsTest.php \Drupal\Tests\node\Functional\NodeCacheTagsTest::createEntity()
Overrides EntityCacheTagsTestBase::createEntity
File
-
core/
modules/ node/ tests/ src/ Functional/ NodeCacheTagsTest.php, line 30
Class
- NodeCacheTagsTest
- Tests the Node entity's cache tags.
Namespace
Drupal\Tests\node\FunctionalCode
protected function createEntity() {
// Create a "Camelids" node type.
NodeType::create([
'name' => 'Camelids',
'type' => 'camelids',
])->save();
// Create a "Llama" node.
$node = Node::create([
'type' => 'camelids',
]);
$node->setTitle('Llama')
->setPublished()
->save();
return $node;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.