You are here

protected function EntityReferenceKernelTest::getTestEntities in Entity Usage 8

Creates two test entities.

Return value

array An array of entity objects.

1 call to EntityReferenceKernelTest::getTestEntities()
EntityReferenceKernelTest::setUp in tests/src/Kernel/EntityReferenceKernelTest.php

File

tests/src/Kernel/EntityReferenceKernelTest.php, line 221

Class

EntityReferenceKernelTest
Tests basic usage tracking on generic entities.

Namespace

Drupal\Tests\entity_usage\Kernel

Code

protected function getTestEntities() {
  $content_entity_1 = EntityTest::create([
    'name' => $this
      ->randomMachineName(),
  ]);
  $content_entity_1
    ->save();
  $content_entity_2 = EntityTest::create([
    'name' => $this
      ->randomMachineName(),
  ]);
  $content_entity_2
    ->save();
  return [
    $content_entity_1,
    $content_entity_2,
  ];
}