You are here

protected function ReorderChildrenContentModerationFunctionalTest::doCreateTestEntity in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/ReorderChildrenContentModerationFunctionalTest.php \Drupal\Tests\entity_hierarchy\Functional\ReorderChildrenContentModerationFunctionalTest::doCreateTestEntity()

Creates the test entity.

Parameters

array $values: Entity values.

Return value

\Drupal\Core\Entity\EntityInterface Created entity.

Overrides EntityHierarchyTestTrait::doCreateTestEntity

1 call to ReorderChildrenContentModerationFunctionalTest::doCreateTestEntity()
ReorderChildrenContentModerationFunctionalTest::testReorderingForDraftParent in tests/src/Functional/ReorderChildrenContentModerationFunctionalTest.php
Tests that the reorder form is linked to the current revision when content_moderation is active.

File

tests/src/Functional/ReorderChildrenContentModerationFunctionalTest.php, line 64

Class

ReorderChildrenContentModerationFunctionalTest
Defines a class for testing the reorder children form.

Namespace

Drupal\Tests\entity_hierarchy\Functional

Code

protected function doCreateTestEntity(array $values) {
  if (!isset($values['moderation_state'])) {
    $values['moderation_state'] = 'published';
  }
  $entity = EntityTestRev::create($values);
  return $entity;
}