You are here

public function EntityDefinitionUpdateTest::testGetEntityTypes 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::testGetEntityTypes()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testGetEntityTypes()

@covers ::getEntityTypes

File

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

Class

EntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testGetEntityTypes() {
  $entity_type_definitions = $this->entityDefinitionUpdateManager
    ->getEntityTypes();

  // Ensure that we have at least one entity type to check below.
  $this
    ->assertGreaterThanOrEqual(1, count($entity_type_definitions));
  foreach ($entity_type_definitions as $entity_type_id => $entity_type) {
    $this
      ->assertEquals($this->entityDefinitionUpdateManager
      ->getEntityType($entity_type_id), $entity_type);
  }
}