protected function EntityQueryAlterCacheabilityTest::createNodeType in Group 8
Same name and namespace in other branches
- 2.0.x tests/src/Kernel/EntityQueryAlterCacheabilityTest.php \Drupal\Tests\group\Kernel\EntityQueryAlterCacheabilityTest::createNodeType()
Creates a node type.
Parameters
array $values: (optional) The values used to create the entity.
Return value
\Drupal\node\Entity\NodeType The created node type entity.
1 call to EntityQueryAlterCacheabilityTest::createNodeType()
- EntityQueryAlterCacheabilityTest::setUp in tests/
src/ Kernel/ EntityQueryAlterCacheabilityTest.php
File
- tests/
src/ Kernel/ EntityQueryAlterCacheabilityTest.php, line 118
Class
- EntityQueryAlterCacheabilityTest
- Tests grouped entities query access cacheability.
Namespace
Drupal\Tests\group\KernelCode
protected function createNodeType(array $values = []) {
$storage = $this->entityTypeManager
->getStorage('node_type');
$node_type = $storage
->create($values + [
'type' => $this
->randomMachineName(),
'label' => $this
->randomString(),
]);
$storage
->save($node_type);
return $node_type;
}