diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 75b67460e62964ba56b728d5fbf006200d029397..529395ecc61bed64ea5fec0ef1788512236694a9 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -2493,12 +2493,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/tests/Drupal/Tests/Composer/ComposerTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: method.deprecated
-	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php',
-];
 $ignoreErrors[] = [
 	// identifier: method.deprecated
 	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
index 63e02c778f40715adfc2ecce9e618720a55b05d7..03c2aa85c9ffa13656261766b0b877cd57ada9ec 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
@@ -160,7 +160,7 @@ protected function setUp(): void {
     $container->set('theme_handler', $this->themeHandler->reveal());
     \Drupal::setContainer($container);
 
-    $this->entity = $this->getMockBuilder(ConfigEntityBaseMockableClass::class)
+    $this->entity = $this->getMockBuilder(StubConfigEntity::class)
       ->setConstructorArgs([$values, $this->entityTypeId])
       ->onlyMethods([])
       ->getMock();
@@ -335,7 +335,7 @@ public static function providerCalculateDependenciesWithPluginCollections(): arr
    * @covers ::onDependencyRemoval
    */
   public function testCalculateDependenciesWithThirdPartySettings(): void {
-    $this->entity = $this->getMockBuilder(ConfigEntityBaseMockableClass::class)
+    $this->entity = $this->getMockBuilder(StubConfigEntity::class)
       ->setConstructorArgs([[], $this->entityTypeId])
       ->onlyMethods([])
       ->getMock();
@@ -570,7 +570,7 @@ public function testToArray(): void {
    * @covers ::toArray
    */
   public function testToArrayIdKey(): void {
-    $entity = $this->getMockBuilder(ConfigEntityBaseMockableClass::class)
+    $entity = $this->getMockBuilder(StubConfigEntity::class)
       ->setConstructorArgs([[], $this->entityTypeId])
       ->onlyMethods(['id', 'get'])
       ->getMock();
@@ -748,10 +748,3 @@ public function getPluginCollections() {
   }
 
 }
-
-/**
- * A class extending ConfigEntityBase for testing purposes.
- */
-class ConfigEntityBaseMockableClass extends ConfigEntityBase {
-
-}
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
index ca7f7f05d2769a2d46b15c9a94c535956fedf16e..0330e1b60b2af1e96e59c48cb0af1529372e9eea 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@@ -13,7 +13,6 @@
 use Drupal\Core\Config\ConfigDuplicateUUIDException;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Config\ConfigManagerInterface;
-use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\Config\Entity\ConfigEntityStorage;
 use Drupal\Core\Config\Entity\ConfigEntityType;
@@ -29,6 +28,7 @@
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Tests\UnitTestCase;
+use PHPUnit\Framework\MockObject\MockObject;
 use Prophecy\Argument;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -695,10 +695,13 @@ public function testDeleteNothing(): void {
    * @param array $methods
    *   (optional) The methods to mock.
    *
-   * @return \Drupal\Core\Entity\EntityInterface|\PHPUnit\Framework\MockObject\MockObject
+   * @return \Drupal\Core\Config\Entity\ConfigEntityInterface&\PHPUnit\Framework\MockObject\MockObject
    */
-  public function getMockEntity(array $values = [], $methods = []) {
-    return $this->getMockForAbstractClass(ConfigEntityBase::class, [$values, 'test_entity_type'], '', TRUE, TRUE, TRUE, $methods);
+  public function getMockEntity(array $values = [], array $methods = []): ConfigEntityInterface&MockObject {
+    return $this->getMockBuilder(StubConfigEntity::class)
+      ->setConstructorArgs([$values, 'test_entity_type'])
+      ->onlyMethods($methods)
+      ->getMock();
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/StubConfigEntity.php b/core/tests/Drupal/Tests/Core/Config/Entity/StubConfigEntity.php
new file mode 100644
index 0000000000000000000000000000000000000000..5ef946268ef05132a84e8747b66e0e9cf2d60823
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/StubConfigEntity.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Drupal\Tests\Core\Config\Entity;
+
+use Drupal\Core\Config\Entity\ConfigEntityBase;
+
+/**
+ * A stub extending ConfigEntityBase for testing purposes.
+ */
+class StubConfigEntity extends ConfigEntityBase {
+
+}