diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index fb1cfaade122d73779529d5407c945c1b0c9a164..3ec9c78dafacd8d80a5b3674f5d9929b919527c3 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -2487,12 +2487,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Entity/EntityFormTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: method.deprecated
-	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Entity/EntityLinkTest.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/Entity/EntityLinkTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
index 61a11b78edce6afe8c8c672128f0326d9b78983e..7dde864fdeb5411d584c5edaba3b80898c1cf477 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
@@ -4,11 +4,11 @@
 
 namespace Drupal\Tests\Core\Entity;
 
-use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Link;
+use Drupal\Tests\Core\Config\Entity\StubConfigEntity;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -95,11 +95,10 @@ public function testToLink($entity_label, $link_text, $expected_text, $link_rel
       ->with($entity_type_id)
       ->willReturn($entity_type);
 
-    /** @var \Drupal\Core\Entity\Entity $entity */
-    $entity = $this->getMockForAbstractClass(ConfigEntityBase::class, [
+    $entity = new StubConfigEntity(
       ['id' => $entity_id, 'label' => $entity_label, 'langcode' => 'es'],
       $entity_type_id,
-    ]);
+    );
 
     $expected_link = Link::createFromRoute(
       $expected_text,