diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayFormBaseTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayFormBaseTest.php
index bdf6000289f2dfb01362c88dd9682cb38059e639..e9799236535c3a340776fe8e73bfb8e26e1e54f8 100644
--- a/core/modules/field_ui/tests/src/Functional/EntityDisplayFormBaseTest.php
+++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayFormBaseTest.php
@@ -4,6 +4,7 @@
 
 namespace Drupal\Tests\field_ui\Functional;
 
+use Drupal\entity_test\EntityTestHelper;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\Tests\BrowserTestBase;
@@ -31,7 +32,7 @@ class EntityDisplayFormBaseTest extends BrowserTestBase {
   protected function setUp(): void {
     parent::setUp();
 
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       // Auto-create fields for testing.
       FieldStorageConfig::create([
         'entity_type' => $entity_type,
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install
index 1c8d21cbdf70ac423d43228c0f1676df8e3d0e78..0e61b7f4ff9b275cb4a4de45dbe55e5ac6a8ab62 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.install
+++ b/core/modules/system/tests/modules/entity_test/entity_test.install
@@ -7,6 +7,7 @@
 
 declare(strict_types=1);
 
+use Drupal\entity_test\EntityTestHelper;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\Entity\FieldConfig;
 
@@ -14,7 +15,7 @@
  * Implements hook_install().
  */
 function entity_test_install(): void {
-  foreach (entity_test_entity_types() as $entity_type) {
+  foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
     // Auto-create fields for testing.
     FieldStorageConfig::create([
       'entity_type' => $entity_type,
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module
index 387830f246432015ea2bc9aa022dcd5e128a0402..66667dfd725360a4340c7f6d51de6ade80ceed61 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -11,66 +11,6 @@
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Form\FormStateInterface;
 
-/**
- * Filter that limits test entity list to revisable ones.
- */
-const ENTITY_TEST_TYPES_REVISABLE = 1;
-
-/**
- * Filter that limits test entity list to multilingual ones.
- */
-const ENTITY_TEST_TYPES_MULTILINGUAL = 2;
-
-/**
- * Filter that limits test entity list to ones that can be routed.
- */
-const ENTITY_TEST_TYPES_ROUTING = 3;
-
-/**
- * Returns a list of test entity types.
- *
- * The returned entity types are one for each available entity storage type:
- * - The plain entity_test type supports neither revisions nor multilingual
- *   properties.
- * - The entity_test_mul type supports multilingual properties.
- * - The entity_test_rev type supports revisions.
- * - The entity_test_mulrev type supports both revisions and multilingual
- *   properties.
- *
- * @param int $filter
- *   Either ENTITY_TEST_TYPES_REVISABLE to only return revisable entity types or
- *   ENTITY_TEST_TYPES_MULTILINGUAL to only return multilingual ones. Defaults
- *   to NULL, which returns all.
- *
- * @return array
- *   List with entity_types.
- */
-function entity_test_entity_types($filter = NULL) {
-  $types = [];
-  if ($filter === NULL || $filter === ENTITY_TEST_TYPES_ROUTING) {
-    $types[] = 'entity_test';
-  }
-  if ($filter != ENTITY_TEST_TYPES_REVISABLE) {
-    $types[] = 'entity_test_mul';
-    $types[] = 'entity_test_mul_langcode_key';
-    $types[] = 'entity_test_mul_changed';
-  }
-  if ($filter != ENTITY_TEST_TYPES_MULTILINGUAL) {
-    $types[] = 'entity_test_rev';
-  }
-  if ($filter === ENTITY_TEST_TYPES_ROUTING) {
-    $types[] = 'entity_test_base_field_display';
-    $types[] = 'entity_test_string_id';
-    $types[] = 'entity_test_uuid_id';
-    $types[] = 'entity_test_no_id';
-    $types[] = 'entity_test_mul_with_bundle';
-  }
-  $types[] = 'entity_test_mulrev';
-  $types[] = 'entity_test_mulrev_changed';
-
-  return array_combine($types, $types);
-}
-
 /**
  * Creates a new bundle for entity_test entities.
  *
diff --git a/core/modules/system/tests/modules/entity_test/src/EntityTestHelper.php b/core/modules/system/tests/modules/entity_test/src/EntityTestHelper.php
new file mode 100644
index 0000000000000000000000000000000000000000..1cc35789e19cd392d5225367455fb249495916cc
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_test/src/EntityTestHelper.php
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Drupal\entity_test;
+
+/**
+ * Class for the entity API providing several entity types for testing.
+ */
+class EntityTestHelper {
+
+  /**
+   * Returns a list of test entity types.
+   *
+   * The returned entity types are one for each available entity storage type:
+   * - The plain entity_test type supports neither revisions nor multilingual
+   *   properties.
+   * - The entity_test_mul type supports multilingual properties.
+   * - The entity_test_rev type supports revisions.
+   * - The entity_test_mulrev type supports both revisions and multilingual
+   *   properties.
+   *
+   * @param int $filter
+   *   Either EntityTestTypesFilter::Revisable to only return revisable entity types or
+   *   EntityTestTypesFilter::Multilingual to only return multilingual ones. Defaults
+   *   to NULL, which returns all.
+   *
+   * @return array
+   *   List with entity_types.
+   */
+  public static function getEntityTypes($filter = NULL): array {
+    $types = [];
+    if ($filter === NULL || $filter === EntityTestTypesFilter::Routing) {
+      $types[] = 'entity_test';
+    }
+    if ($filter != EntityTestTypesFilter::Revisable) {
+      $types[] = 'entity_test_mul';
+      $types[] = 'entity_test_mul_langcode_key';
+      $types[] = 'entity_test_mul_changed';
+    }
+    if ($filter != EntityTestTypesFilter::Multilingual) {
+      $types[] = 'entity_test_rev';
+    }
+    if ($filter === EntityTestTypesFilter::Routing) {
+      $types[] = 'entity_test_base_field_display';
+      $types[] = 'entity_test_string_id';
+      $types[] = 'entity_test_uuid_id';
+      $types[] = 'entity_test_no_id';
+      $types[] = 'entity_test_mul_with_bundle';
+    }
+    $types[] = 'entity_test_mulrev';
+    $types[] = 'entity_test_mulrev_changed';
+
+    return array_combine($types, $types);
+  }
+
+}
diff --git a/core/modules/system/tests/modules/entity_test/src/EntityTestTypesFilter.php b/core/modules/system/tests/modules/entity_test/src/EntityTestTypesFilter.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7c47a4963d2434ab891badd15b313934b7327ef
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_test/src/EntityTestTypesFilter.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Drupal\entity_test;
+
+/**
+ * Enumeration of test entity types filter.
+ */
+enum EntityTestTypesFilter: int {
+
+  // Filter that limits test entity list to revisable ones.
+  case Revisable = 1;
+
+  // Filter that limits test entity list to multilingual ones.
+  case Multilingual = 2;
+
+  // Filter that limits test entity list to ones that can be routed.
+  case Routing = 3;
+
+}
diff --git a/core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php b/core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php
index c6eef6663292c53b7a28c837e951e3eaf15b5fcb..bdaf0416b83758a1749ec7e22551bbf700c11af3 100644
--- a/core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php
+++ b/core/modules/system/tests/modules/entity_test/src/Hook/EntityTestHooks.php
@@ -21,6 +21,7 @@
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\entity_test\EntityTestHelper;
 
 /**
  * Hook implementations for entity_test.
@@ -36,7 +37,7 @@ class EntityTestHooks {
   public function entityTypeAlter(array &$entity_types) : void {
     $state = \Drupal::state();
     /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       // Optionally specify a translation handler for testing translations.
       if ($state->get('entity_test.translation')) {
         $translation = $entity_types[$entity_type]->get('translation');
diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php
index e13e6e45727472bbf0b6beb8c811fa4ec8f1786c..528a43ddbe4f172171e15ea43662368b54063100 100644
--- a/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php
+++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php
@@ -5,6 +5,8 @@
 namespace Drupal\entity_test\Plugin\Derivative;
 
 use Drupal\Component\Plugin\Derivative\DeriverBase;
+use Drupal\entity_test\EntityTestHelper;
+use Drupal\entity_test\EntityTestTypesFilter;
 
 /**
  * Defines the local tasks for all the entity_test entities.
@@ -16,7 +18,7 @@ class EntityTestLocalTasks extends DeriverBase {
    */
   public function getDerivativeDefinitions($base_plugin_definition) {
     $this->derivatives = [];
-    $types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
+    $types = EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Routing);
 
     foreach ($types as $entity_type) {
       $this->derivatives[$entity_type . '.canonical'] = [];
diff --git a/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php b/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php
index 39c49a3998b9704240679e88311a1ec985f54e44..6481ccb428e1a9a46c8aa641383b4713bf347c7c 100644
--- a/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php
+++ b/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php
@@ -4,6 +4,8 @@
 
 namespace Drupal\entity_test\Routing;
 
+use Drupal\entity_test\EntityTestHelper;
+use Drupal\entity_test\EntityTestTypesFilter;
 use Symfony\Component\Routing\Route;
 
 /**
@@ -18,7 +20,7 @@ class EntityTestRoutes {
    *   An array of route objects.
    */
   public function routes() {
-    $types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
+    $types = EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Routing);
 
     $routes = [];
     foreach ($types as $entity_type_id) {
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
index ae6f7243ecff09dca7dee2f168511f979318915a..cb555a811ada25254d55534b500d5aaf21e38764 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
@@ -7,6 +7,8 @@
 use Drupal\Core\Entity\Entity\EntityFormDisplay;
 use Drupal\Core\Entity\Entity\EntityFormMode;
 use Drupal\entity_test\Entity\EntityTest;
+use Drupal\entity_test\EntityTestHelper;
+use Drupal\entity_test\EntityTestTypesFilter;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\Tests\BrowserTestBase;
 
@@ -54,7 +56,7 @@ protected function setUp(): void {
    */
   public function testFormCRUD(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestFormCRUD($entity_type);
     }
   }
@@ -64,7 +66,7 @@ public function testFormCRUD(): void {
    */
   public function testMultilingualFormCRUD(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Multilingual) as $entity_type) {
       $this->doTestMultilingualFormCRUD($entity_type);
     }
   }
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
index 7101989b65ef33067db0efbfbf6db17a93669eec..199daa93c7d2f6d36399f2f4b0ffad19a56e33e5 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
@@ -5,6 +5,8 @@
 namespace Drupal\Tests\system\Functional\Entity;
 
 use Drupal\entity_test\Entity\EntityTestMulRev;
+use Drupal\entity_test\EntityTestHelper;
+use Drupal\entity_test\EntityTestTypesFilter;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -57,7 +59,7 @@ protected function setUp(): void {
   public function testRevisions(): void {
 
     // All revisable entity variations have to have the same results.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_REVISABLE) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Revisable) as $entity_type) {
       $this->runRevisionsTests($entity_type);
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
index 07ae276d8e7b555d14bc61768602be11de447c42..f4f1b70eac526170297b1d7df8191a674da3b837 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
@@ -7,6 +7,7 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\Entity\EntityStorageException;
 use Drupal\entity_test\Entity\EntityTest;
+use Drupal\entity_test\EntityTestHelper;
 use Drupal\user\UserInterface;
 
 /**
@@ -22,7 +23,7 @@ class EntityApiTest extends EntityKernelTestBase {
   protected function setUp(): void {
     parent::setUp();
 
-    foreach (entity_test_entity_types() as $entity_type_id) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type_id) {
       // The entity_test schema is installed by the parent.
       if ($entity_type_id != 'entity_test') {
         $this->installEntitySchema($entity_type_id);
@@ -35,7 +36,7 @@ protected function setUp(): void {
    */
   public function testCRUD(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->assertCRUD($entity_type, $this->createUser());
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
index 4641f58f40ae87ab0eb91f7f68b63fbab5b67813..08af66e967a8232268acbf739ccbed2c21051d37 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
@@ -5,6 +5,7 @@
 namespace Drupal\KernelTests\Core\Entity;
 
 use Drupal\Component\Uuid\Uuid;
+use Drupal\entity_test\EntityTestHelper;
 
 /**
  * Tests default values for entity fields.
@@ -34,7 +35,7 @@ protected function setUp(): void {
    */
   public function testDefaultValues(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->assertDefaultValues($entity_type);
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
index fe70fda8b5727d04b5debffb45ffd3384fbddc99..5e34ef2dc17817d2f6efed0dfda9e6ca5bda6390 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
@@ -23,6 +23,7 @@
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\entity_test\Entity\EntityTestComputedField;
 use Drupal\entity_test\Entity\EntityTestRev;
+use Drupal\entity_test\EntityTestHelper;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
 
@@ -59,7 +60,7 @@ class EntityFieldTest extends EntityKernelTestBase {
   protected function setUp(): void {
     parent::setUp();
 
-    foreach (entity_test_entity_types() as $entity_type_id) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type_id) {
       // The entity_test schema is installed by the parent.
       if ($entity_type_id != 'entity_test') {
         $this->installEntitySchema($entity_type_id);
@@ -136,7 +137,7 @@ public function testFieldEntityRevisionWrite(): void {
    */
   public function testReadWrite(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestReadWrite($entity_type);
     }
   }
@@ -402,7 +403,7 @@ protected function doTestReadWrite($entity_type): void {
    */
   public function testSave(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestSave($entity_type);
     }
   }
@@ -439,7 +440,7 @@ protected function doTestSave($entity_type): void {
    */
   public function testIntrospection(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestIntrospection($entity_type);
     }
   }
@@ -543,7 +544,7 @@ protected function doTestIntrospection($entity_type): void {
    */
   public function testIterator(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestIterator($entity_type);
     }
   }
@@ -582,7 +583,7 @@ protected function doTestIterator($entity_type): void {
    */
   public function testDataStructureInterfaces(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestDataStructureInterfaces($entity_type);
     }
   }
@@ -654,7 +655,7 @@ public function getContainedStrings(TypedDataInterface $wrapper, $depth, array &
    */
   public function testDataTypes(): void {
     $types = \Drupal::typedDataManager()->getDefinitions();
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->assertNotEmpty($types['entity:' . $entity_type]['class'], 'Entity data type registered.');
     }
     // Check bundle types are provided as well.
@@ -774,7 +775,7 @@ public function testEntityConstraintValidation(): void {
    */
   public function testComputedProperties(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestComputedProperties($entity_type);
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php
index 3922e80da303fc1ff6b5e070b48620d2c967de8e..95b78ede4e96af417392a76c03060a6c79d92668 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php
@@ -4,6 +4,7 @@
 
 namespace Drupal\KernelTests\Core\Entity;
 
+use Drupal\entity_test\EntityTestHelper;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
@@ -54,7 +55,7 @@ protected function setUp(): void {
 
     $this->languageManager = $this->container->get('language_manager');
 
-    foreach (entity_test_entity_types() as $entity_type_id) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type_id) {
       // The entity_test schema is installed by the parent.
       if ($entity_type_id != 'entity_test') {
         $this->installEntitySchema($entity_type_id);
@@ -77,7 +78,7 @@ protected function setUp(): void {
     $this->untranslatableFieldName = $this->randomMachineName() . '_field_name';
 
     // Create field fields in all entity variations.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       FieldStorageConfig::create([
         'field_name' => $this->fieldName,
         'entity_type' => $entity_type,
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php
index 3d75bf3b29d2c435a83b51b7fb0281982ee36402..1ed5e387f84876ec1fa272d756dde676a7d4c57d 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php
@@ -6,6 +6,8 @@
 
 use Drupal\entity_test\Entity\EntityTestMul;
 use Drupal\entity_test\Entity\EntityTestMulRev;
+use Drupal\entity_test\EntityTestHelper;
+use Drupal\entity_test\EntityTestTypesFilter;
 use Drupal\language\Entity\ConfigurableLanguage;
 
 /**
@@ -174,7 +176,7 @@ public function testSetNewRevision(): void {
     $user = $this->createUser();
 
     // All revisionable entity variations have to have the same results.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_REVISABLE) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Revisable) as $entity_type) {
       $this->installEntitySchema($entity_type);
       $storage = \Drupal::entityTypeManager()->getStorage($entity_type);
 
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
index 35b18ce53ca3a3219d1bed051d91ba38454267d6..e09aafb52ee02f2c494a5159dc9e0428ab8bc828 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
@@ -8,6 +8,8 @@
 use Drupal\Core\TypedData\TranslationStatusInterface;
 use Drupal\entity_test\Entity\EntityTestMul;
 use Drupal\entity_test\Entity\EntityTestMulRev;
+use Drupal\entity_test\EntityTestHelper;
+use Drupal\entity_test\EntityTestTypesFilter;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -24,7 +26,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
    */
   public function testEntityLanguageMethods(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->doTestEntityLanguageMethods($entity_type);
     }
   }
@@ -144,7 +146,7 @@ protected function doTestEntityLanguageMethods($entity_type): void {
    */
   public function testMultilingualProperties(): void {
     // Test all entity variations with data table support.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Multilingual) as $entity_type) {
       $this->doTestMultilingualProperties($entity_type);
     }
   }
@@ -307,7 +309,7 @@ protected function doTestMultilingualProperties($entity_type): void {
    */
   public function testEntityTranslationAPI(): void {
     // Test all entity variations with data table support.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Multilingual) as $entity_type) {
       $this->doTestEntityTranslationAPI($entity_type);
     }
   }
@@ -575,7 +577,7 @@ protected function doTestEntityTranslationAPI($entity_type): void {
    */
   public function testLanguageFallback(): void {
     // Test all entity variations with data table support.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Multilingual) as $entity_type) {
       $this->doTestLanguageFallback($entity_type);
     }
   }
@@ -716,7 +718,7 @@ public function testFieldDefinitions(): void {
    */
   public function testLanguageChange(): void {
     // Test all entity variations with data table support.
-    foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes(EntityTestTypesFilter::Multilingual) as $entity_type) {
       $this->doTestLanguageChange($entity_type);
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
index 984d8abca38e27cc8e595e008a6a0152d1044b79..dee6c23dff8e723c9481c4a5ac35e9ec1f582740 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
@@ -4,6 +4,8 @@
 
 namespace Drupal\KernelTests\Core\Entity;
 
+use Drupal\entity_test\EntityTestHelper;
+
 /**
  * Tests creation, saving, and loading of entity UUIDs.
  *
@@ -17,7 +19,7 @@ class EntityUUIDTest extends EntityKernelTestBase {
   protected function setUp(): void {
     parent::setUp();
 
-    foreach (entity_test_entity_types() as $entity_type_id) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type_id) {
       // The entity_test schema is installed by the parent.
       if ($entity_type_id != 'entity_test') {
         $this->installEntitySchema($entity_type_id);
@@ -30,7 +32,7 @@ protected function setUp(): void {
    */
   public function testCRUD(): void {
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->assertCRUD($entity_type);
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
index 7e0fdfbda57300d7f76e9fc91cc3b88b430cf43e..54799c7be428cb8c4b7e156896b5ea26fe4a4ff7 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
@@ -6,6 +6,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase;
+use Drupal\entity_test\EntityTestHelper;
 use Drupal\language\Entity\ConfigurableLanguage;
 
 /**
@@ -116,7 +117,7 @@ public function testValidation(): void {
     $this->assertContains('Drupal\Core\Validation\ConstraintManager', $cached_discovery_classes);
 
     // All entity variations have to have the same results.
-    foreach (entity_test_entity_types() as $entity_type) {
+    foreach (EntityTestHelper::getEntityTypes() as $entity_type) {
       $this->checkValidation($entity_type);
     }
   }