You are here

protected function EntityAccessComplexTest::createNodeType in Group 8

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

File

tests/src/Kernel/EntityAccessComplexTest.php, line 980

Class

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