You are here

private function RabbitHoleBehaviorPluginTest::createTestEntity in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/RabbitHoleBehaviorPluginTest.php \Drupal\Tests\rabbit_hole\Functional\RabbitHoleBehaviorPluginTest::createTestEntity()

Create an entity for testing.

Return value

\Drupal\node\NodeInterface Created node.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to RabbitHoleBehaviorPluginTest::createTestEntity()
RabbitHoleBehaviorPluginTest::setUp in tests/src/Functional/RabbitHoleBehaviorPluginTest.php

File

tests/src/Functional/RabbitHoleBehaviorPluginTest.php, line 168

Class

RabbitHoleBehaviorPluginTest
Test the functionality of the RabbitHoleBehavior plugin.

Namespace

Drupal\Tests\rabbit_hole\Functional

Code

private function createTestEntity() {
  $node = Node::create([
    'nid' => NULL,
    'type' => self::TEST_CONTENT_TYPE_ID,
    'title' => 'Test Behavior Settings Node',
  ]);
  $node
    ->save();
  return $node;
}