function EntityDefinitionUpdateTest::testGetEntityTypes

Tests get entity types.

@legacy-covers ::getEntityTypes

File

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

Class

EntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testGetEntityTypes() : void {
  $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);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.