You are here

protected function RelationHandlerTest::createNodeType in Group 2.0.x

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 RelationHandlerTest::createNodeType()
RelationHandlerTest::setUp in tests/src/Kernel/RelationHandlerTest.php

File

tests/src/Kernel/RelationHandlerTest.php, line 62

Class

RelationHandlerTest
Tests that relation handlers work as expected.

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