You are here

protected function EntityQueryAlterComplexTest::createNodeType in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/EntityQueryAlterComplexTest.php \Drupal\Tests\group\Kernel\EntityQueryAlterComplexTest::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 EntityQueryAlterComplexTest::createNodeType()
EntityQueryAlterComplexTest::setUp in tests/src/Kernel/EntityQueryAlterComplexTest.php

File

tests/src/Kernel/EntityQueryAlterComplexTest.php, line 561

Class

EntityQueryAlterComplexTest
Tests that Group properly checks access for "complex" grouped entities.

Namespace

Drupal\Tests\group\Kernel

Code

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;
}