diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
index 0802812bf65b52966f2007a42c394f6426a81c37..933c678d4314529e3a312788d943e9fcca51f723 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
@@ -15,7 +15,6 @@
 use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
 use Drupal\Core\Entity\EntityFieldManager;
-use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
@@ -195,16 +194,12 @@ protected function setUp(): void {
    *   (optional) An array of entity type definitions.
    */
   protected function setUpEntityTypeDefinitions($definitions = []) {
-    $class = $this->getMockClass(EntityInterface::class);
     foreach ($definitions as $key => $entity_type) {
       // \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates() is called
       // by \Drupal\Core\Entity\EntityTypeManager::processDefinition() so it must
       // always be mocked.
       $entity_type->getLinkTemplates()->willReturn([]);
 
-      // Give the entity type a legitimate class to return.
-      $entity_type->getClass()->willReturn($class);
-
       $definitions[$key] = $entity_type->reveal();
     }
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php
index 67c78921f17441763bb6a82fbfb4c4526b860556..344af4a889b963b65b1717278f7e7a57c3d5f17f 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php
@@ -6,7 +6,6 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
-use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeBundleInfo;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
@@ -112,16 +111,12 @@ protected function setUp(): void {
    *   (optional) An array of entity type definitions.
    */
   protected function setUpEntityTypeDefinitions($definitions = []) {
-    $class = $this->getMockClass(EntityInterface::class);
     foreach ($definitions as $key => $entity_type) {
       // \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates() is called
       // by \Drupal\Core\Entity\EntitTypeManager::processDefinition() so it must
       // always be mocked.
       $entity_type->getLinkTemplates()->willReturn([]);
 
-      // Give the entity type a legitimate class to return.
-      $entity_type->getClass()->willReturn($class);
-
       $definitions[$key] = $entity_type->reveal();
     }
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
index edb6240e1fab96cb1f532b478b372043ba769b85..f6a34fc4bdb2dc13edd7513ead02240642226e05 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
@@ -97,7 +97,7 @@ protected function setUp(): void {
    *   (optional) An array of entity type definitions.
    */
   protected function setUpEntityTypeDefinitions($definitions = []) {
-    $class = $this->getMockClass(EntityInterface::class);
+    $class = get_class($this->createMock(EntityInterface::class));
     foreach ($definitions as $key => $entity_type) {
       // \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates() is called
       // by \Drupal\Core\Entity\EntityTypeManager::processDefinition() so it must
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php
index 356e573e4028ee9322d05777f2ce2128dc8f2793..cc71399e8ac7d568cdd4165cafdc04b65277632e 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php
@@ -50,7 +50,6 @@ protected function setUp(): void {
    *   (optional) An array of entity type definitions.
    */
   protected function setUpEntityTypeDefinitions($definitions = []) {
-    $class = $this->getMockClass(EntityInterface::class);
     foreach ($definitions as $key => $entity_type) {
       // \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates() is called
       // by \Drupal\Core\Entity\EntityTypeManager::processDefinition() so it must
@@ -58,7 +57,7 @@ protected function setUpEntityTypeDefinitions($definitions = []) {
       $entity_type->getLinkTemplates()->willReturn([]);
 
       // Give the entity type a legitimate class to return.
-      $entity_type->getClass()->willReturn($class);
+      $entity_type->getClass()->willReturn(EntityInterface::class);
 
       $definitions[$key] = $entity_type->reveal();
     }
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php b/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php
index 6cbac0d67fdc5962dc7a34fc9440083fcbb29d56..bff677cec036f6c1f2da15455427fe9a7f92f756 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php
@@ -6,7 +6,6 @@
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
-use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -78,16 +77,12 @@ protected function setUp(): void {
    *   (optional) An array of entity type definitions.
    */
   protected function setUpEntityTypeManager($definitions = []) {
-    $class = $this->getMockClass(EntityInterface::class);
     foreach ($definitions as $key => $entity_type) {
       // \Drupal\Core\Entity\EntityTypeInterface::getLinkTemplates() is called
       // by \Drupal\Core\Entity\EntityTypeManager::processDefinition() so it must
       // always be mocked.
       $entity_type->getLinkTemplates()->willReturn([]);
 
-      // Give the entity type a legitimate class to return.
-      $entity_type->getClass()->willReturn($class);
-
       $definitions[$key] = $entity_type->reveal();
     }