diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 6a000ff90e21de5123a06c376070470b3cc2fd2a..fb1cfaade122d73779529d5407c945c1b0c9a164 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -2151,12 +2151,6 @@
 	'count' => 2,
 	'path' => __DIR__ . '/modules/views/tests/src/Kernel/Plugin/StyleTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: method.deprecated
-	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder\\.$#',
-	'count' => 5,
-	'path' => __DIR__ . '/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php',
-];
 $ignoreErrors[] = [
 	// identifier: method.deprecated
 	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\.$#',
diff --git a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
index f9b941374a234dced218790e767115f6ccacafc0..05cf8840cf60896c2011674edfead1ff54d41bf7 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
@@ -82,7 +82,7 @@ public function testGetDerivativeDefinitionsWithoutLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->once())
       ->method('getOption')
       ->with('menu')
@@ -137,7 +137,7 @@ public function testGetDerivativeDefinitionsWithLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->once())
       ->method('getOption')
       ->with('menu')
@@ -194,7 +194,7 @@ public function testGetDerivativeDefinitionsWithOverrideRoute(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->once())
       ->method('getOption')
       ->with('menu')
@@ -243,7 +243,7 @@ public function testGetDerivativeDefinitionsWithDefaultLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->exactly(2))
       ->method('getOption')
       ->with('menu')
@@ -316,7 +316,7 @@ public function testGetDerivativeDefinitionsWithExistingLocalTask(): void {
     $display_plugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->onlyMethods(['getOption', 'getPath'])
       ->disableOriginalConstructor()
-      ->getMockForAbstractClass();
+      ->getMock();
     $display_plugin->expects($this->exactly(2))
       ->method('getOption')
       ->with('menu')