You are here

protected function EntityHierarchyTestTrait::doCreateChildTestEntity in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/EntityHierarchyTestTrait.php \Drupal\Tests\entity_hierarchy\Traits\EntityHierarchyTestTrait::doCreateChildTestEntity()

Creates a new test entity.

Parameters

int|null $parentId: Parent ID.

string $label: Entity label.

int $weight: Entity weight amongst sibling, if parent is set.

Return value

\Drupal\Core\Entity\EntityInterface New entity.

1 call to EntityHierarchyTestTrait::doCreateChildTestEntity()
EntityHierarchyTestTrait::createChildEntities in tests/src/Traits/EntityHierarchyTestTrait.php
Create child entities.
2 methods override EntityHierarchyTestTrait::doCreateChildTestEntity()
HierarchyNestedSetRevisionIntegrationTest::doCreateChildTestEntity in tests/src/Kernel/HierarchyNestedSetRevisionIntegrationTest.php
Creates a new test entity.
ViewsRevisionableIntegrationTest::doCreateChildTestEntity in tests/src/Kernel/ViewsRevisionableIntegrationTest.php
Creates a new test entity.

File

tests/src/Traits/EntityHierarchyTestTrait.php, line 170

Class

EntityHierarchyTestTrait
Defines a trait for common testing methods for entity hierarchy.

Namespace

Drupal\Tests\entity_hierarchy\Traits

Code

protected function doCreateChildTestEntity($parentId, $label, $weight) {
  return $this
    ->createTestEntity($parentId, $label, $weight);
}