You are here

protected function EntityDefinitionUpdateTest::setUp in Drupal 9

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

Overrides EntityKernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php, line 64

Class

EntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
  parent::setUp();
  $this->entityDefinitionUpdateManager = $this->container
    ->get('entity.definition_update_manager');
  $this->entityFieldManager = $this->container
    ->get('entity_field.manager');
  $this->database = $this->container
    ->get('database');

  // Install every entity type's schema that wasn't installed in the parent
  // method.
  foreach (array_diff_key($this->entityTypeManager
    ->getDefinitions(), array_flip([
    'user',
    'entity_test',
  ])) as $entity_type_id => $entity_type) {
    $this
      ->installEntitySchema($entity_type_id);
  }
}