You are here

protected function EntityReferenceFieldTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php \Drupal\KernelTests\Core\Entity\EntityReferenceFieldTest::setUp()

Overrides EntityKernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php, line 67

Class

EntityReferenceFieldTest
Tests for the entity reference field.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('entity_test_rev');

  // Create a field.
  $this
    ->createEntityReferenceField($this->entityType, $this->bundle, $this->fieldName, 'Field test', $this->referencedEntityType, 'default', [
    'target_bundles' => [
      $this->bundle,
    ],
  ], FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
}