You are here

protected function GroupContentCreateAccessTest::createNodeType in Group 8

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

File

tests/src/Kernel/GroupContentCreateAccessTest.php, line 327

Class

GroupContentCreateAccessTest
Tests the group content create access for groups.

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